PHP Runtime Checklist
PHP incidents often come from runtime differences: CLI PHP is one version, PHP-FPM is another, the web server loads a different php.ini, or an extension exists on staging but not production. The official PHP manual keeps installation notes at php.net/manual/en/install.php; this page focuses on operational checks after PHP is present.
Identify PHP
php -v
which php
php --ini
php -m
php -i | grep -E 'Loaded Configuration|memory_limit|upload_max_filesize|post_max_size'Composer and dependencies
composer --version
composer validate
composer diagnose
composer show --direct
composer outdated --directPHP-FPM and web server
Do not assume CLI PHP and web PHP are identical. Check FPM pools, service state and web server error logs.
systemctl status php-fpm --no-pager
systemctl status php8.2-fpm --no-pager
journalctl -u php-fpm -n 80 --no-pager
nginx -t
apachectl configtestCommon PHP runtime failures
| Symptom | Check first | Typical cause |
|---|---|---|
| Works in CLI, fails in browser | php --ini, FPM pool config, web logs | Different config file, user, permissions or extension set. |
| Class not found | composer dump-autoload, vendor directory | Autoload cache or missing dependency deployment. |
| File upload fails | upload_max_filesize, post_max_size, temp directory | Config limit or write permission. |
| Database connection fails | PDO extension, DSN, firewall, credentials | Missing extension or host reachability problem. |
Deployment evidence
git rev-parse --short HEAD
php -v
composer install --no-dev --prefer-dist --optimize-autoloader
php artisan config:cache 2>/dev/null
systemctl reload php-fpm 2>/dev/null
systemctl reload nginx 2>/dev/nullBefore changing PHP code, prove the runtime. Version, config file, extensions, service user and web server logs usually narrow the bug faster than guessing.
Related: Linux Admin Commands, Windows Admin Commands, API Debugging Handbook.