Back to Knowledge Base
Knowledge Base PHP & Server Configuration Viewing PHP and Server Error Logs

Viewing PHP and Server Error Logs

PHP & Server Configuration 30/11/2026

Error logs are your first tool for debugging website problems.

PHP Error Log Location

Your PHP error log is typically at:

~/logs/php_errors.log

or

~/domains/yourdomain.com/logs/error.log

Check DirectAdmin → Error Logs to find the exact location.

Viewing Logs via SSH

# View the last 50 lines
tail -50 ~/logs/php_errors.log

# Watch live as errors occur
tail -f ~/logs/php_errors.log

# Search for a specific error
grep "Fatal error" ~/logs/php_errors.log | tail -20

Viewing Logs via DirectAdmin

Log in to DirectAdmin → Error Logs under Advanced Features to view recent errors in your browser.

Enable PHP Error Display (Development Only)

Add to .user.ini or wp-config.php:

; .user.ini
display_errors = On
error_reporting = E_ALL
log_errors = On
error_log = /home/yourusername/logs/php_errors.log

⚠️ Never enable display_errors on a production site — it reveals sensitive server information.

Apache Access and Error Logs

# Access log (shows all requests)
tail -100 ~/logs/yourdomain.com/access.log

# Error log (shows server errors)
tail -100 ~/logs/yourdomain.com/error.log

Common Error Types

Error Cause
Fatal error: Allowed memory size exhausted Increase memory_limit
Maximum execution time exceeded Increase max_execution_time
Call to undefined function Missing PHP extension or function
No input file specified .htaccess routing issue
Was this article helpful?