FastCGI timeout error MAMP Pro 4

懵懂的女人 提交于 2019-12-06 07:21:43

问题


I looked into older questions

https://craftcms.stackexchange.com/questions/4661/fastcgi-error-when-accessing-a-local-development-site-using-mamp-pro/6573#6573?newreg=aa4ad11b453f4c7f93882ce478d837a3

How do you increase the apache fastCGI timeout on MAMP / MAMP Pro?

but my configuration is quite differente because I'm using MAMP Pro 4 and I have multiple PHP versions running

I tried to edit MAMP/fcg-bin/phpx.x.x.fcgi and add -idle-timeout 3600, since it seems a little cleaner

#!/bin/sh
export PHP_FCGI_CHILDREN=4
export PHP_FCGI_MAX_REQUESTS=200
exec /Applications/MAMP/bin/php/php5.4.45/bin/php-cgi -c "/Library/Application Support/appsolute/MAMP PRO/conf/php5.4.45.ini" -idle-timeout 3600

and also

#!/bin/sh
export PHP_FCGI_CHILDREN=4
export PHP_FCGI_MAX_REQUESTS=200
exec /Applications/MAMP/bin/php/php5.6.30/bin/php-cgi -c "/Library/Application Support/appsolute/MAMP PRO/conf/php5.6.30.ini" -idle-timeout 3600

but it doesn't seem to have any effect i still get the same error

FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php5.6.30.fcgi" aborted: idle timeout (30 sec)

and i also try to edit apache > httpd.conf

#MAMP_FastCgiServer_MAMP
FastCgiServer /Applications/MAMP/fcgi-bin/php5.4.45.fcgi -idle-timeout 2400
FastCgiServer /Applications/MAMP/fcgi-bin/php5.6.30.fcgi -idle-timeout 3600

in this case Apache would not start


回答1:


The only way it seem to be possible is by checking Xdebug in PHP tab. I did try that before, but did not seem to work on first attempt. I then checked, save, quit and relaunch MAMP PRO and it worked.




回答2:


I had this problem (MAMP Pro 4.6). It turned out it was caused by a PHP script I had that was stuck in an infinite loop and timed out. However, restarting the servers in MAMP did nothing. It seemed to only fix itself after restarting the actual MAMP application as shown below.

Obviously, you need to fix the script that is timing out but to get MAMP going again without a restart or having to edit httpd.conf:

  1. Stop the servers
  2. Open up Activity Monitor and search for php-cgi
  3. Force quit all occurrences of php-cgi
  4. Start the servers

You should find it runs again without issue. If it does happen again, just repeat the four steps.



来源:https://stackoverflow.com/questions/44281157/fastcgi-timeout-error-mamp-pro-4

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