WEBSITE SHOWING WHITE SCREEN, READ THE LOG FILE!
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.
There are 2 types of PHP errors:
Changefalsetotrueand save.
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............................................................. |
- 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.
|
01 |
define('WP_DEBUG', false); |