Techieshelp.com

PHP Website White Screen and No Source

As mentioned before I am not a coder, Website designer or anything along those lines. I like to mess around with little web projects here and there, most of my websites are WordPress driven. On a little project I am working on at the moment id built the site and I knew the PHP I was using was fine. Once I uploaded it to my server I got nothing, zip. All I had was a nice white screen in my web browser and if I right clicked to view source code then it revealed that nothing was running at all.

After a bit of research I realized that I had to find out what errors where being generated. With the code below inserted into your .HTAccess you can get your PHP driven website to report its errors within the web browser screen, to help diagnose issues.

php_value display_errors 1

With this line of code in in the HTAccess I could see that the website was generating the following error.

PHP Parse Error: syntax error, unexpected $end

Again after further research I found that this was an issue with my server, namely PHP not being able to read the PHP short tags that was in the script I was using. To fix this issue we need to enable PHP to read short tags. Do so by entering the following code in your HTAccess for individual sites or for all sites hosted on your server, then enter it into your PHP.ini.

php_value short_open_tag 1

Now with Short Tags Enabled in PHP my website fired up. The only issue I had was that it was showing various errors on screen that where not important. I wanted to filter these errors. I did so with the following code.

php_value error_reporting 2

This means that these errors are not logged in any of your logs and they will not show up on screen in your browser. Now that the site is running I could remove the initial error reporting PHP line that gave me a hint at what was broke on my site.