WEBSITE SHOWING WHITE SCREEN, READ THE LOG FILE!

Wordpress 8 min read
Many years ago, when web servers had many limitations, whenever a website had code errors, it would display the error code directly on the website for everyone to see. For administrators, this would help you identify which file had the error and where in the code. For malicious hackers, they would exploit that error as a bug to infiltrate, for example. That's why nowadays hosting providers and default web server settingshide error messages in codeto increase security, instead of showing errors, most code errors now display as awhite screen, also known as awhite screen error. I've been asked many questions like "Um, my website is showing a white screen, how do I fix it?"To be honest, even if I grew another brain, I couldn't fix a blank page error based solely on the statement "my website has a blank page error". I'm saying this so you understand that blank page errors or 500 Internal Server errors have tens of thousands of different causes, but all of them stem from either webserver configuration (.htaccess for Apache and .conf file for NGINX) or from code on your website.

Solutions

To fix the error, we need to know the cause. Once we identify the cause, whether you're a newbie or a pro, you can fix the error yourself by reading the error log file. There you'll find the exact cause of the problem.

For white page errors

100% of white page errors originate from your code, such as calling a non-existent function, incorrect syntax, extra characters, etc. To fix this error, open your error log file and check it. This log file usually has a name like error_log, error.log or similar and will be located in the /public_html directory forShared Host, for private servers (VPS/Dedicated), open the configuration file of your domain that's experiencing errors and you'll see the log declaration line—follow that path to open it. If you're using Shared Hosting and can't find the log file, contact our technical support team and they'll help you locate it. The log file content looks like this:
01
02
[21-Aug-2014 21:40:17 UTC] PHP Warning:  stripslashes() expects parameter 1 to be string, object given in /path/xxx/example.com/public_html/file.php on line XXX
[21-Aug-2014 21:40:17 UTC] PHP Fatal Error: XXX.............................................................
There are 2 types of PHP errors:
  • PHP Warning– Warnings with normal severity level; these warnings don't cause website interruption and are hidden by default. If you set WP_DEBUG to TRUE in your wp-config.php file, warnings will be displayed on your website
  • PHP Fatal Error– This is a critical error that prevents PHP from continuing execution, which causes the white screen error.
Errors in the log file are listed line by line, with each line representing one error occurrence. When an access triggers an error, it displays one line and may repeat multiple times. To read the log, you should read from top to bottom corresponding to the order from oldest to newest errors, or you can use the timestamp at the beginning of each line as a reference. In each error line, you will see what the error is and which file caused it. If you want to know the meaning of the error, search it on Google; the important thing is identifying which file is causing the issue. If the file belongs to a plugin, simply disable the plugin by renaming its folder. If there is no error_log file, please open thewp-config.phpand find:
01
define('WP_DEBUG', false);
Changefalsetotrueand save.

For Error 500

Error 500 originates from Webserver configuration issues such as syntax errors in configuration files that prevent the Webserver from restarting. More precisely, your browser is not receiving transmission signals from the Webserver. If you useShared Hostthen this error usually has 2 causes: you inserted .htaccess file content with incorrect syntax or the .htaccess file CHMOD is wrong. Fix it by deleting the .htaccess file content and accessing again; if it still shows an error, set the CHMOD for the.htaccessfile to 755, 644 or 744. If you use a dedicated server (VPS, Dedicatedthen open the webserver log file, which will be located in the/var/log/httpd(Apache) or/var/log/nginx(NGINX) directory to see which configuration file has an error, usually occurring when you manually edit VirtualHost configuration files.

Conclusion

People say give a fishing rod instead of a fish, and knowing how to read log files is like owning a fishing rod that lets you fix any error instead of running around asking questions and getting nowhere. Remember,all website errors are recorded in the log fileincluding error 500, blank page errors, image upload failures, etc. So just pull up the log file and read it; I also have to be able to read the log file to fix it.
READY TO GET STARTED?

Build a more efficient digital business.

Let our experts recommend the best-fit solution for your business.

Talk to an expert Free and fast consultation
Call for advice