0

I'm used to working with MAMP instead of Nitro and would like to keep this setup as I find it easy to manage my other older setups.

As MAMP (Pro) support is until MySQL 5.7.34 and as Craft CMS 4 required MySQL 5.7.8+, how can I make it works with this current setup?

1 Answer 1

1

Craft 4 works fine in MAMP Pro (I'm using v6.6). Bear in mind that 5.7.34 is actually higher than 5.7.8 - these are not decimals, they're semver numbering.

10
  • Thank you. I was about to try this out, but I'm stucked with this error after the composer create-project: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.21. Any idea why? There's no export PATH in my .bash_profile. I'm not using yet MAMP at this step. Jun 22 at 15:14
  • yeh, this is a bit fiddly when you have multiple projects that need php 8 vs 7. There are probably a few different ways of solving this. If you go to MAMP's PHP settings and set your default as 8.1.0, then tick the box that says "Activate command line shortcut..." then MAMP will create a .profile file in your home directory which exports the 8.1.0 binary into your $PATH and aliases "php" to point to the 8.1.0 binary. For older projects that still need PHP 7, I duplicated that alias to "php7" and pointed to the MAMP 7.4.21 binary. Jun 22 at 16:51
  • To pinpoint which binary you're using, type which php. If your $PATH variable is getting set in other places, like .bash_profile, or .zshrc or .bashrc etc, then it might also be a source of confusion. Type echo $PATH to see where your shell will look for binaries. Jun 22 at 16:55
  • Finally, don't forget to source your changes after making any manual updates to your .profile / .bash_profile / .zshrc / .bashrc. Type source [filename]. Or restart your terminal session. Jun 22 at 16:57
  • Thank you! I'm still not able to use Craft 4 (because of In CreateProjectCommand.php line 323: chdir(): No such file or directory (errno 2) on install), but the problem should be somewhere else, so I'm already validating your answer. Btw, for the command line use with MAMP: how can you switch efficiently between multiple versions of PHP? And did you get like me warning in the MAMP phpMyAdmin since the move to PHP 8.1? Jun 23 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.