Troubleshooting
Enable PHP error logging from cPanel
Before changing anything, check which PHP version runs the failing path and note the current value of log_errors. The selector saves options per version, and a directory may have a different version set in its .htaccess.
Log in to cPanel, go to Select PHP Version, open the Options tab for the effective version and set log_errors to On. The change is saved automatically.
Keep display_errors set to Off. In production, errors must go to the log, not the browser, because they may contain paths, queries, credentials or other internal data.
Before reproducing the failure, check the effective destination of error_log and that it cannot be downloaded from the web. A file called error_log inside the application directory is not private just because of its name. If you can configure the destination, use a private directory outside the public root and restrict its permissions.
Reproduce only the failing operation and check that log. If nothing appears, check that the request actually reached PHP, the error_reporting level and the write permissions; the server may use another destination.
When you finish, set log_errors back to the value it had before the test and delete the log once it is no longer needed. The change affects every website on the account that uses the same PHP version.
Also keep the time, with time zone, and the URL of the test so you can find its entry. If permanent logging was already in place, keep that configuration and its rotation policy; remove only the temporary diagnostic changes. A screenshot of the selector helps you find the option, but the final check must be done on the website that was failing.
You may also find useful
- Debug errors in PHP applications or files Diagnose a blank screen or a 500 error by reproducing the failure and checking the most specific log...
- Log PHP errors for a specific file Capture errors from a single PHP file in a private, temporary log, keeping display_errors off so det...
- Xdebug for debugging remote PHP code Set up a remote Xdebug 3 session with a private trigger and a reverse SSH tunnel, without exposing t...
- auto_prepend_file and auto_append_file Trace the request that reinfects an application by using auto_prepend_file to log only selected meta...
Something wrong or out of date? Tell us and we will review it.