Skip to main content
All CollectionsWebsiteWebsite Troubleshooting
How to identify and fix website errors
How to identify and fix website errors

Learn how to identify and resolve issues that cause your website to be offline

Updated over 5 months ago

The solutions provided below do not apply to websites created with Hostinger Website Builder. If you have a builder-based website, refer here instead: Website Builder: Website is not working 💡

It’s common in website development to encounter errors that you don’t know about. This is why it’s extremely useful to have a feature that lets you find a solution based on the information you already have.

Identifying website errors

First, you need to turn on PHP error messages:

  • To make errors visible on your website directly, add a checkmark for the displayErrors (display_errors) parameter.

  • To make errors logged in a specific file, mark logErrors (log_errors):

Once done, save your changes and access your website again. You will now see specific error messages to work on.

General recommendations

  1. Ensure the scripts are uploaded in the correct mode — ASCII or Binary. Check the readme file of your script to see any special instructions. Normally, it should be ASCII.

  2. Check your file or directory's (folder's) permission (chmod) values. The recommended file permissions are 644, and the recommended folder permissions are 755.

  3. If you've added some additional configurations to your .htaccess file, make sure to double-check it and ensure that it doesn't contain any errors. To confirm whether it's an issue with the .htaccess file, just temporarily rename it.

  4. Add timeout rules directly to your PHP scripts to prevent your PHP code from timing out.

  5. The most important tip is to search on Google for your script name + internal server error or website builder + error message. Most likely, someone already had the same issue and explained a solution online, e.g., WordPress error establishing a database connection.

How to fix specific errors

Also, you can take a closer look at the error code. Fixing the source reason might solve your issue without restoration from backup:

  • Call to undefined function means that in some file(s) the website is trying to call the function, that was not defined properly yet. It usually happens when an incorrect PHP version is chosen. Try changing the PHP version first.

  • Parse error (Syntax Error) happens when the code you've written doesn't conform to the syntax or language rules for the language in which you work. In cases like these, check the file in the given location to see if there are easy syntax errors that you can fix. Usually, it’s something simple, like a missing ; symbol at the end of the line.

  • Warning error means that a file is missing or that the code is using incorrect parameters in a function. If you see Access denied for a user after “Warning”, check if the database credentials are correct in your website's configuration file.

  • Fatal error typically occurs when the code uses a require() function and cannot find the required file. Check the file in question and upload it (or restore it from the backup).

  • A Depreciated error means that your website needs a lower PHP version than is currently set. Changing the PHP version to a lower one will solve the issue.

NOTES

  • Search by using your website builder/plugin's forum. It’s more likely to find a solution there.

  • Stack Overflow is a popular forum/community website where developers all around the world share their issues and solutions.

  • You can also always hire a professional developer to take care of your website.

Did this answer your question?