skip to Main Content

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


  1. Install the 14-day trial of MAMP Pro and start it up. Then, close MAMP Pro and open MAMP.

    Login or Signup to reply.
  2. 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:

    “Also, having started Apache from the terminal, URL rewrites aren’t working.”

    Looking in the Apache log in MAMP shows tons of lines like this when attempting to access projects that have .htaccess directives with RewriteEngine on and such:

    .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
    

    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:

    #LoadModule rewrite_module modules/mod_rewrite.so
    

    Why that core mod_rewrite functionality disabled by default? No idea. But just uncomment that line as shown below:

    LoadModule rewrite_module modules/mod_rewrite.so
    

    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 run mysql and mysqldump 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 and mysqldump) are stored in their relative versions directory:

    /Applications/MAMP/Library/bin/mysql57/bin
    /Applications/MAMP/Library/bin/mysql80/bin
    

    A quick and simple way to clear ups this issue is to go into the main bin/ directory from the Terminal like so:

    cd /Applications/MAMP/Library/bin
    

    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:

    ln -s mysql80/bin/mysqldump mysqldump
    ln -s mysql80/bin/mysql mysql
    

    MySQL database files location related changes in MAMP 7.

    And finally, the actual MySQL database files are similarly stored in their relative versions directory:

    /Applications/MAMP/db/mysql57
    /Applications/MAMP/db/mysql80
    

    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:

    rm -rf /Applications/MAMP/db/mysql80
    

    Then move the mysql57/ directory to mysql80/ like so:

    mv /Applications/MAMP/db/mysql57 /Applications/MAMP/db/mysql80
    

    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/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search