Why won't Apache Server start in MAMP?

2019-02-11 15:39发布

I'm trying to view php files locally on my mac.

I'm running Yosemite.

I have MAMP installed on my computer. When I press start the MySQL server starts but Apache doesn't. An error message appears saying 'Error. Apache couldn't be started. Please check your MAMP installation'

I've gone through the internet typing stuff into terminal and changing 'envvars' to '_envvars' but nothing works.

I reinstalled OSX and that worked but when I shut down the computer the problem occurs again.

Can anyone help?

Thanks

11条回答
2楼-- · 2019-02-11 16:04

If you try to start the server from the terminal, likely that will tell you what is wrong e.g.

$ sudo /Applications/MAMP/bin/startApache.sh

Password:

(48)Address already in use: make_sock: could not bind to address [::]:8888 (48)Address already in use: make_sock: could not bind to address 0.0.0.0:8888

no listening sockets available, shutting down

Unable to open logs

In this case, I was inadvertently running a Blockstack browser out of 8888, so changing MAMP to 8887 allowed it to start. [Your mistake might be different.]

查看更多
劫难
3楼-- · 2019-02-11 16:07

Absolutely bizarre behavior for MAMP PRO (paid license too btw...)

In my case I had to change the location of the log file in order to get it to work...

Click on Mysql icon then the little folder to the right of the path and try changing it to something else.

enter image description here

查看更多
小情绪 Triste *
4楼-- · 2019-02-11 16:08

I had this experience when upgrading to V4. It tried to used the files from my previous installation and it just never worked. The workaround was to RENAME the original MAMP installation to something different than "MAMP", install brand new version and then copy files you may need like VHOST configs and DATABASES. After all this it worked just fine.

查看更多
迷人小祖宗
5楼-- · 2019-02-11 16:09

I didn't get it working with port 8000 or the default 8888, but did get it working with port 80 per the suggestion here: http://forums.macrumors.com/showthread.php?t=1744944

That didn't work after all, but it didn't error out. However I manually ran the following at the command line (because log file was empty):

sudo /Applications/MAMP/Library/bin/apachectl start

Only to find that after upgrading I was missing the mod_example.so

httpd: Syntax error on line 83 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/Library/modules/mod_example.so into server: dlopen(/Applications/MAMP/Library/modules/mod_example.so, 10): image not found

Copied it from my old install and I was good to go.

查看更多
forever°为你锁心
6楼-- · 2019-02-11 16:12

i've solved this issue using this command in the terminal :

sudo apachectl stop
查看更多
成全新的幸福
7楼-- · 2019-02-11 16:13

Had the same problem, nothing in the logs. After trying the_dillio's suggestion:

sudo /Applications/MAMP/Library/bin/apachectl start

I got an error that pointed back to my vhosts file. It turns out I had an extra /VirtualHost tag. Removed it and it started working again.

查看更多
登录 后发表回答