When a PHP site shows a blank page, a 500 error or a broken feature, PHP almost always writes the reason to a log. Learning to find and read that line turns guesswork into a five-minute fix.
Before you start
- cPanel access (one click from Services in the dashboard).
- A backup before you edit code; MdmHost keeps daily JetBackup copies, see restore files with JetBackup.
Where PHP errors are logged
- error_log files: in cPanel → Files → File Manager, look for a file named
error_login the folder of the script that failed (for examplepublic_html/error_logorpublic_html/wp-admin/error_log). Enable Settings → Show Hidden Files if needed. - cPanel → Metrics → Errors: the last web server errors for your account.
- More on both: cPanel error log and raw access logs.
Read an error line
[13-Nov-2026 09:12:44 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/user/public_html/inc/db.php:14Read it left to right: time, severity, message, then the file and line. Fix the newest Fatal error first; warnings and notices rarely break a page.
| Severity | Effect |
|---|---|
| Fatal error / Parse error | Script stops; blank page or 500 |
| Warning | Script continues; something may not work |
| Notice / Deprecated | Harmless now, but will break in a future PHP version |
Fix the most common PHP errors
| Message | Fix |
|---|---|
Allowed memory size of ... bytes exhausted | Raise memory_limit; see memory exhausted fix |
Call to undefined function | Missing PHP extension or removed function; enable the extension or update the code |
syntax error, unexpected ... | Typo in the named file and line, or code written for a newer PHP version |
Maximum execution time of 30 seconds exceeded | Raise max_execution_time or fix the slow task |
Failed opening required | Missing file or wrong path after a move |
Change PHP version and settings
- Pick the PHP version in cPanel → Software → Select PHP Version (CloudLinux) or MultiPHP Manager. Guide: Select PHP version and extensions.
- Enable missing extensions on the Extensions tab.
- Adjust
memory_limit,max_execution_timeandupload_max_filesizeon the Options tab.
Turn on debugging safely
Never show errors to visitors on a live site. Log them instead. For WordPress, add to wp-config.php above That's all, stop editing:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);Errors then go to wp-content/debug.log. Set WP_DEBUG back to false when you're done, and delete the log.
Warning: Large error_log files use disk space and inodes. Fix the repeating error, then delete the file.
