I’ve upgraded the devops tool MAMP, with the Apache or Nginx web servers, MySQL database server and PHP, from MAMP 6 to MAMP 7 on macOS and when I start MAMP, I get a dialogue that says:
‘Apache couldn’t be started. Please check your MAMP installation and configuration.’
There is nothing in /Applications/MAMP/logs/apache_error.log
for the time when I try to start it.
If I do /Applications/MAMP/Library/bin/apachectl start
in terminal, then it starts, but the log then says:
/Applications/MAMP/fcgi-bin/php.fcgi: line 4: exec: /Applications/MAMP/bin/php/php8.3.1/bin/php-cgi: cannot execute: No such file or directory
/Applications/MAMP/fcgi-bin/php.fcgi: line 4: /Applications/MAMP/bin/php/php8.3.1/bin/php-cgi: No such file or directory
This is very strange, as MAMP is set to run 8.3.8.
Furthermore there is a symlink /Applications/MAMP/conf/php8.3.1
which is broken, as its target /Applications/MAMP/bin/php/php8.3.1/conf
doesn’t exist — there is no php8.3.1 folder.
Also, having started Apache from the terminal, URL rewrites aren’t working.
P.S. There are other questions about the same error message but as far as I can tell, they are all about much older versions of MAMP.
2
Answers
Install the 14-day trial of MAMP Pro and start it up. Then, close MAMP Pro and open MAMP.
Re-enabling
mod_rewrite
in MAMP 7.While there is already good answer about launching MAMP Pro prior to launching plain old MAMP, I feel this issue reported by the original poster was not addressed:
Looking in the Apache log in MAMP shows tons of lines like this when attempting to access projects that have
.htaccess
directives withRewriteEngine on
and such:The way to fix this is to open up
httpd.conf
file in the/Applications/MAMP/conf/apache
directory and go to line 179; shown here:Why that core
mod_rewrite
functionality disabled by default? No idea. But just uncomment that line as shown below:Stop and start the servers again in MAMP and you should be good to go! Your projects will start working again.
MySQL binary location related changes in MAMP 7.
In addition to that
mod_rewrite
issue, you might run into issues when attempting to runmysql
andmysqldump
from the command line.The reason is MAMP 7 is bundled with MySQL 5.7 and MySQL 8.0. So each of those binaries (
mysql
andmysqldump
) are stored in their relative versions directory:A quick and simple way to clear ups this issue is to go into the main
bin/
directory from the Terminal like so:And create symbolic links like so; I am choosing MySQL 8.0 in this example since MySQL 8.0 is the default database of MAMP nowadays:
MySQL database files location related changes in MAMP 7.
And finally, the actual MySQL database files are similarly stored in their relative versions directory:
If you are upgrading from from MAMP 6.9, your database files might all be in the
/Applications/MAMP/db/mysql57
directory.To get them loaded into MySQL 8.0 (the default database of MAMP) just stop all MAMP servers and delete the default MySQL 8.0 files:
Then move the
mysql57/
directory tomysql80/
like so:Stop and start the servers again in MAMP and you should be good to go! Your databases should all now be present in MySQL 8.0 which can be checked/confirmed by going to the phpMyAdmin URL:
http://localhost:8888/phpMyAdmin5/