This documentation will help you locate and enable error logs in cPanel and Plesk, allowing you to identify and fix problems that might otherwise remain hidden.
Whether you're running into issues with your website or simply want to monitor for potential problems, knowing how to access these logs is crucial for effective web hosting management.
Finding Error Logs in cPanel
Disclaimer: Always test these steps in a development environment first. This guide was created based on current versions of cPanel and Plesk. Please check the official documentation for the most up-to-date information as interfaces may change.
Key Terms for Beginners:
- Error Logs: Text files that record problems, errors, and warnings that occur on your server.
- cPanel/Plesk: Control panel software that helps you manage your hosting account without needing technical knowledge.
- SSH: Secure Shell - a protocol that lets you connect to your server securely via the command line.
- Terminal/Command Line: Text interface where you can type commands directly to your server.
Method 1: Using the Error Log Interface
- Log in to your cPanel account.
- In the "Metrics" section, click on Error Log.
- Your most recent error logs will be displayed on this page.
- You can use the search function to filter specific errors.
Method 2: Using File Manager
- Log in to your cPanel account.
- In the "Files" section, click on File Manager.
- Navigate to the
/public_html
directory. - Look for the
error_log
file (sometimes it may be hidden). - If hidden files aren't visible, click on "Settings" in the top right and check "Show Hidden Files".
- Right-click on the file and select "View" to see the contents.
Method 3: Using SSH (Advanced)
- Connect to your server via SSH.
- Navigate to your website's root directory with:
cd ~/public_html
- View the error log with:
cat error_log
ortail -f error_log
for real-time monitoring. - For PHP errors, check:
cat /var/log/php-fpm/error.log
(path may vary by server configuration).
Common cPanel Error Log Locations
- Apache error logs:
/usr/local/apache/logs/error_log
- Domain-specific error logs:
/home/username/public_html/error_log
- PHP error logs:
/var/log/php-fpm/error.log
or/var/log/php-fpm/www-error.log
- Email error logs:
/var/log/exim_mainlog
- MySQL error logs:
/var/lib/mysql/hostname.err
Finding Error Logs in Plesk
Method 1: Using Plesk Interface
- Log in to your Plesk Control Panel.
- Click on Websites & Domains.
- Select the domain you want to check.
- Click on Logs in the right sidebar.
- You can view different types of logs including:
- Web server access logs
- Web server error logs
- FTP logs
- PHP error logs
Method 2: Using File Manager
- Log in to your Plesk Control Panel.
- Click on Files in the left navigation.
- Navigate to
/var/www/vhosts/yourdomain.com/logs
. - Look for files named
error_log
,proxy_error_log
, or similar. - Click on the file to view its contents.
Method 3: Using SSH (Advanced)
- Connect to your server via SSH.
- Navigate to your website's logs directory:
cd /var/www/vhosts/yourdomain.com/logs
- View the error log with:
cat error_log
ortail -f error_log
for real-time monitoring. - For system-wide logs, check:
cd /var/log
and explore relevant directories.
Common Plesk Error Log Locations
- Domain error logs:
/var/www/vhosts/yourdomain.com/logs/error_log
- PHP error logs:
/var/www/vhosts/yourdomain.com/logs/php_error.log
- Plesk panel errors:
/var/log/plesk/panel.log
- Apache error logs:
/var/log/httpd/error_log
(CentOS/RHEL) or/var/log/apache2/error.log
(Debian/Ubuntu) - MySQL error logs:
/var/log/mysql/error.log
or/var/lib/mysql/hostname.err
Troubleshooting Tips
Enable Error Logging
If you don't see error logs, you may need to enable them in your PHP configuration:
For cPanel with MultiPHP INI Editor:
- Go to cPanel > Software > MultiPHP INI Editor.
- Select your domain.
- Set the following values:
display_errors = Off
(for production sites)log_errors = On
error_log = /path/to/error_log
- Click "Apply" to save changes.
For cPanel with CloudLinux PHP Selector:
- Log in to your cPanel account.
- Navigate to "Software" > "Select PHP Version".
- Click on the "Switch to PHP Options" tab.
- Click on "Options" tab.
- Find and enable the following options:
- Set
display_errors
toOff
(for production sites) - Set
log_errors
toOn
- Set
- Click "Apply" to save all changes.
- Note: PHP Selector allows setting different PHP versions and configurations per user or per directory, offering legacy PHP versions not available in MultiPHP Manager.
For Plesk:
- Go to Websites & Domains > select your domain > PHP Settings.
- Set the appropriate error reporting values.
- Click "OK" to save changes.
For Plesk with CloudLinux PHP Selector:
- Log in to your Plesk Control Panel.
- Go to "Websites & Domains" and select the domain you want to configure.
- Click on "PHP Settings" in the right sidebar.
- If CloudLinux is installed, you'll see "PHP Selector" - click on it.
- Select your desired PHP version from the dropdown menu.
- In the "PHP Settings" section below:
- Set
display_errors
toOff
(for production) - Set
log_errors
toOn
- Set
- If available for your account, click on "Custom Values" tab.
- Add a new custom value:
error_log
with the value/var/www/vhosts/yourdomain.com/logs/php_errors.log
- Click "OK" or "Apply" to save your changes.
Common Issues
- Empty log files: Error logging might be disabled in PHP configuration.
- Permission denied: Ensure you have sufficient permissions to access log files.
- Log rotation: Some logs may be archived. Look for files with date extensions like
error_log.1
.
Monitoring Logs in Real-Time
Using SSH, you can monitor logs in real-time with:
tail -f /path/to/error_log
This displays new entries as they're added to the log file.
Pro Tip: For large log files, use grep
to filter for specific errors:
grep "Fatal error" /path/to/error_log