Internal Server Error on PHP requests > 29 seconds

All MAMP discussions around troubleshooting and anything related to MAMP. Be as detailed as possible here when posting an issue.
Post Reply
designosis
Posts: 1
Joined: Fri Dec 30, 2022 12:32 am

Internal Server Error on PHP requests > 29 seconds

Post by designosis »

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:

Code: Select all

max_execution_time = 60
However this simple PHP code ...

Code: Select all

<?php
    sleep(30);
    echo 'SUCCESS';
... 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:
  • 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.
From the CLI, running this code with `sleep(30)` or higher works as expected (no errors). The code (and the max_execution_time directive) works as expected on other servers.

Any advice on how to get MAMP working when a process takes ≥30 seconds?
Post Reply