Internal Server Error on PHP requests > 29 seconds
Posted: Fri Dec 30, 2022 12:50 am
Running MAMP PRO 6.6.4 (build 34077) on macOS 12.6.2, I use PHP 8.1.11 with the stock php.ini, with a single INI setting adjusted:
However this simple PHP code ...
... shows the ugly white "500 Internal Server Error". If you change `sleep()` in the code above to 29, it works fine. However any sleep value ≥ 30 causes an Internal Server Error.
Notes:
Any advice on how to get MAMP working when a process takes ≥30 seconds?
Code: Select all
max_execution_time = 60
Code: Select all
<?php
sleep(30);
echo 'SUCCESS';
Notes:
- There are no errors in `apache_error.log` or `php_error.log`.
- PHP's `ini_get('max_execution_time')` shows 60, so it's being set correctly.
- I see an Apache module "reqtimeout_module" is active, but don't understand how I'd go about seeing or changing its settings. Disabling this module has no effect.
- This error happens with all version of PHP. I've tried 5.6.40, 7.1.33, 7.4.21, and older 8.1 versions, each time only changing `max_execution_time = 60` in the INI.
Any advice on how to get MAMP working when a process takes ≥30 seconds?