Debugging errors is one of the integral tasks for any programmer or system administrator who runs a website. It is caused by various factors, for instance, faulty file placement, improper permissions, and so on. These errors can cause websites to go down for minutes to hours, affect the website’s search engine ranking, etc if we didn’t fix it in a minimal time. Here are 4 common cPanel errors and a guide on how to fix them.
Initial Investigation: Checking Error logs
The cPanel control panel includes an error log section. Here you can find up to 300 of the most recent entries in your web server’s error logs for that user, in reverse chronological order. To access the Error log, follow the steps below;
- In the cPanel control panel, Go to the “Metrics” section.
- Click “Errors” in the “Metrics” section.
- The newly opened page will show the logged errors of that user in reverse chronological order.
Reading the error log in cPanel can help you identify and troubleshoot issues with your website. This includes broken links, server errors, or coding errors. Once you have identified the problem, you can take steps to fix it. Thereby ensuring your website is functioning properly. If this issue is still unknown, you can try basic fixes by checking the errors based on the HTTP error code seen on your website.
1. 401 Bad Request
A “401 Bad Request” error typically occurs when the server is unable to authenticate the user’s credentials. This may be caused by a number of issues. Say incorrect login details or insufficient permissions to access the requested resource.
If you are experiencing a “401 Bad Request” error in cPanel, there are a few things you can try out, to resolve the issue:
- Check your login credentials: Make sure that you are entering the correct username and password for your cPanel account. Double-check for typos or spelling errors.
- Clear your browser cache: Sometimes, browser caches can cause login issues. Try clearing your browser cache and then logging in again.
- Check your firewall settings: If you have a firewall enabled, make sure that it is not blocking your cPanel login. You may need to whitelist cPanel in your firewall settings.
- Reset your cPanel password: If you are unable to log in, you can try resetting your cPanel password. This uses the “Forgot Password” option.
2. 403 Forbidden error
A 403 error in cPanel typically indicates that the server has received the request for a particular file or directory. However, the server has denied access to that file or directory for some reason. There are several reasons why you may encounter a 403 error in cPanel, including:
- Incorrect file or directory permissions: The server may not have the correct permissions to access the file or directory in question.
- Incorrect ownership of the file or directory: The owner of the file or directory when not set correctly. This causes the server to deny access.
- Incorrect .htaccess file: If you have a .htaccess file in the directory, it may be preventing the server from accessing the file or directory.
- IP blocking: The server may be blocking your IP address or range, preventing you from accessing the file or directory.
- Mod_security: The mod_security module may be blocking your access to the file or directory due to a security rule violation.
- Missing index file: If you’re trying to access a directory and there is no index file present, the server may be configured to deny directory browsing.
To resolve a 403 error in cPanel, you will need to identify the underlying cause of the error. Further, take the appropriate steps to correct the issue. In most cases, this will involve checking file and directory permissions. This ensures the correct owner is set and reviewing any .htaccess files or security settings that cause the errors.
3. 404 Page not found
If you encounter a 404 error in cPanel, it usually means that the server is unable to find the file or page that you requested. Here are some possible reasons for the error and their solutions:
- Incorrect file or URL: Check that the URL you entered is correct and that the file you are looking for exists in the specified location. If the file has been moved or renamed, update the URL accordingly
- Incorrect permissions: Ensure that the file or directory has the correct permissions set. Files should have 644 permissions and directories should have 755 permissions.
- Corrupted .htaccess file: If you have a .htaccess file in your website’s root directory, it could be causing the 404 error. Try temporarily renaming or deleting the .htaccess file to see if that resolves the issue.
- Broken links: If the 404 error occurs when a link is clicked, the link may be broken. Check the link to ensure that it is correct and not pointing to a non-existent page or file.
- Server misconfiguration: If none of the above solutions work, server misconfiguration could be an issue. Contact your web hosting provider for assistance in resolving the issue.
4. 500 Internal Server Error
The most common error: 500 Internal Server Error is a generic error message that indicates a problem with the server. In the case of cPanel, this error can occur due to various reasons. For example, incorrect file permissions, corrupted .htaccess files, or issues with the server configuration. Here are some steps that you can take to troubleshoot the issue:
- Check file permissions: Incorrect file permissions can cause a 500 error. Check the permissions of the files and directories in question. The permission for the files should be set to 644, and the permission for the directories should be set to 755.
- Check .htaccess files: A corrupted .htaccess file can cause a 500 error. Rename the .htaccess file in question to something else and check if the error goes away.
- Check server configuration: If none of the above steps work, there might be an issue with the server configuration. Contact your web hosting provider or server administrator for assistance.
- Check for updates: Ensure that your cPanel software is up-to-date. Check for any updates that may resolve the issue.
To conclude, cPanel error codes are common yet can be annoying. Understanding the typical error codes and how to fix them will help you rapidly fix problems and resume operating your website. Never hesitate to contact your hosting company for assistance if necessary, and always keep in mind to check the error logs in cPanel for more details on the incident.