WordPress & web hosting
PHP timeout troubleshooting: PHP, PHP-FPM or the web server?
Start with the exact error and its timestamp. A PHP execution-limit error, a terminated PHP-FPM worker and a browser 504 can come from different settings. Raising every timeout can leave more workers tied up without fixing the slow request.
Identify which component stopped waiting
A PHP message saying Maximum execution time exceeded points to PHP's execution timer. A PHP-FPM log describing a request timeout and child termination points to the pool's termination setting. An nginx upstream timed out error can mean the web server stopped waiting for PHP; it does not by itself prove PHP reached its own execution limit.
Match web-server, PHP and application logs by timestamp and request. On shared hosting, use your control panel's logs or ask support for the relevant entry. Do not change server-wide settings that you do not administer.
Check the configuration used by the failing request
This command reads the command-line PHP configuration only. It does not tell you the settings of a website running through PHP-FPM, Apache or another PHP version. A CLI value of zero can be normal and is not a reason to set the website to unlimited execution time.
Use the hosting panel or the actual web PHP configuration to inspect the website. Avoid leaving a public phpinfo page online: it can disclose server and environment details.
php --ini
php -r 'printf("SAPI: %s\nmax_execution_time: %s\n", PHP_SAPI, ini_get("max_execution_time"));'Understand what each limit measures
PHP max_execution_time limits script execution. On non-Windows systems, time spent in some system calls, stream operations and database queries is not counted in the same way as script execution; on Windows the measured time is real elapsed time.
PHP-FPM request_terminate_timeout can terminate a worker that takes too long to serve a request. nginx fastcgi_read_timeout measures the gap between successive reads from the FastCGI server, not a single total duration for the entire response. Your proxy, CDN or application HTTP client can have another limit.
Find what the request is waiting for
Check slow database queries, external HTTP requests, imports, image processing, backup jobs and plugins. Compare the same action with and without the suspected bottleneck in a staging environment. Record its duration before changing a limit.
When you administer PHP-FPM, its slowlog and request_slowlog_timeout can help identify a stuck request. Enable diagnostic logging for an appropriate period, keep the logs private and account for their storage use. A host can help when those settings are not available to you.
Fix the task or change one limit at a time
Move lengthy imports and report jobs to a queue or a controlled background task when the application supports it. Give external API calls their own connection and response timeouts, and handle errors without keeping the web request open indefinitely.
If a legitimate task needs longer, adjust the setting that actually limits it, using an appropriate configuration change and rollback. Retest and watch worker occupancy, memory and response times. A hosting upgrade is useful only when resources or access are the constraint.
Troubleshoot a slow WordPress site | WordPress hosting plans and management responsibilities | Contact DotMoose support