Nginx PHP-FPM Log Correlation Checklist
Nginx and PHP-FPM see different parts of the same request. Nginx records the HTTP layer. PHP-FPM records PHP execution and worker behavior. Correlating both logs helps you diagnose real root causes faster.
Core principle
One request can leave evidence in multiple logs. Match time, URL, status code and backend error before changing configuration.
Checklist
- Record the exact time of the issue.
- Record the affected URL or action.
- Check Nginx access log for status code.
- Check Nginx error log for upstream errors.
- Check PHP-FPM logs for pool warnings.
- Check PHP error logs if configured.
- Compare timestamps across logs.
- Identify whether failure is routing, upstream, PHP error or resource pressure.
- Make one targeted change.
- Verify logs after the fix.
Reusable lesson
This applies to 403, 404, 500, 502, 504, blank pages, slow admin pages, plugin errors and import failures.
When to Use This Checklist
Use this checklist when debugging WordPress or PHP app errors that require evidence from both Nginx and PHP-FPM logs.
Required Tools
SSH access, Nginx access log, Nginx error log, PHP-FPM log, affected URL, incident time
Before You Start
Do not change config based on one log line. Correlate request evidence across Nginx and PHP-FPM first.
Structured Checklist Steps
- Record time.
- Record URL.
- Check access log.
- Check Nginx error log.
- Check PHP-FPM log.
- Check PHP error log.
- Compare timestamps.
- Classify failure layer.
- Make targeted change.
- Verify logs.
Verification Steps
- Status code is known.
- Backend error is confirmed or ruled out.
- PHP-FPM warning is understood.
- Failure layer is classified.
- Post-fix logs are clean.
Rollback Plan
If a targeted fix does not change the log pattern, revert it and test the next hypothesis based on fresh evidence.
Common Mistakes
- Reading only Nginx logs.
- Ignoring timestamps.
- No affected URL recorded.
- Confusing access log status with root cause.
- Making multiple changes at once.
Related Commands
date
sudo tail -n 100 /var/log/nginx/access.log
sudo tail -n 100 /var/log/nginx/error.log
sudo tail -n 100 /var/log/php8.2-fpm.log
journalctl -u php8.2-fpm --since "30 minutes ago"
curl -I https://example.com/problem-url