If your WordPress website hosted on CyberPanel or CloudPanel is experiencing intermediate errors, some common causes include: server configuration issues, resource limitations, or misconfigured WordPress settings.
To identify and address this issue, follow the steps below.
Step 1 – Check the server logs
Examining the server logs during downtime can provide crucial insights into the root cause of the errors. You can find the different logs in the following locations according to your OS template:
CyberPanel
Web server logs
Apache logs
Error log:
/usr/local/lsws/logs/error.log
Access log:
/usr/local/lsws/logs/access.log
LiteSpeed Logs (if using LiteSpeed instead of Apache):
Error log:
/usr/local/lsws/logs/error.log
Stderr log:
/usr/local/lsws/logs/stderr.log
Access log:
/usr/local/lsws/logs/access.log
CyberPanel Logs:
General logs:
/usr/local/CyberCP/logs
CloudPanel
Web Server Logs:
Nginx Logs (default for CloudPanel):
Error log:
/var/log/nginx/error.log
Access log:
/var/log/nginx/access.log
CloudPanel Logs:
General logs:
/var/log/cloudpanel
Specific site logs:
/home/cloudpanel/var/log/
Step 2 – Monitor the resource usage
Monitor CPU and memory usage to identify any spikes that correlate with the errors with the help of command-line tools like htop or top.
You can also review the usage metrics from your Hostinger VPS dashboard. Recurring patterns are often caused by reoccurring tasks (e.g. a product import, or a manual backup cronjob).
Step 3 – Review the access logs
Check your access logs for an unusually high number of requests. If you notice a significant spike, it could indicate bot activity or hacking attempts. In such cases, activating a Content Delivery Network (CDN) like Cloudflare can help mitigate these issues by enhancing security and reducing the load on your server.
Step 4 – Review the cron jobs
Verify that your cron jobs are properly set up. Misconfigured cron jobs can lead to high CPU and memory usage. Tools like WP-Cron Control can help manage WordPress cron jobs more effectively.
Step 5 – Inspect WordPress
Plugins and themes – Disable all plugins and switch to a default theme to verify if the issue persists. This helps identify if a plugin or theme is causing the intermediate error.
Error reporting – Enable WP_DEBUG in your wp-config.php file to get detailed error messages in WordPress by adding the following lines:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
For more detailed steps, you can refer to the following tutorial: What is WordPress debug and how to enable it💡
You can also make use of the following WordPress debugging plugins:
Query Monitor – Helps monitoring database queries, PHP errors, hooks, among others.
Debug Bar – Provides detailed debugging information about WordPress.
Step 6 – Inspect MySQL performance
Use the MySQLTuner script to analyze your MySQL performance:
Download the script using the following command:
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
Make it executable:
chmod +x mysqltuner.pl
And run the script:
./mysqltuner.pl
Next, follow the recommendations provided by MySQLTuner to optimize your MySQL configuration.
Step 7 – Mitigate the issue
Should the issue persist, you can consider the following options:
Increase server resources – If you frequently hit resource limits, consider upgrading your server.
Optimize WordPress using caching plugins to reduce the load and optimizing your database with plugins or manual SQL commands.
Optimize your server configuration – Fine-tune your server configuration to handle higher loads more efficiently.
Activate a CDN – Use a CDN like Cloudflare to provide additional security features, mitigate bot and hacking attempts, and reduce server load.
By following these steps and utilizing the additional debugging tools, MySQL optimization scripts, and CDN services, you can identify and resolve issues causing intermediate errors on your WordPress website hosted on CyberPanel or CloudPanel.