Apache in MAMP Pro 4 has stopped working, refuses to start

China☆狼群 提交于 2020-02-28 23:21:00

问题


Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.

I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...

I've tried numerous suggestions found via Stack Overflow and Google without any success.

Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.

Nothing appears in the logs...

When starting it manually on the command line it comes up with a PHP related error:

$ Applications/MAMP/bin/apache2/bin/apachectl start

httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found

The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.

If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.

apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf

It also looks like hosts entries aren't added to /etc/hosts.

Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...

I and my colleagues are at a complete loss, especially given it was working yesterday...

Has anyone had any issues like this?


回答1:


I managed to fix the similar issue you had. My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.

There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.

(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive

File > Edit Template > Revert ALL Templates to Default Settings. Save & restarted the servers and all worked finally and all my hosts had retained as well.

I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.

Hope this helps.



来源:https://stackoverflow.com/questions/40733536/apache-in-mamp-pro-4-has-stopped-working-refuses-to-start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!