Mystery behind a blank page..

As you start programming in PHP, you can sometimes hit a scenario where the PHP page you are developing appears as a BLANK page when you request the PHP page from a browser. So what should you do under such circumstances? Here are a few tips:

  • Check server logs - Check the error log for your apache server. You should probably get some hints from the error log. Check the apache access log to make sure you are requesting for the right assets.
  • If checking the server logs don’t help, try adding some print/echo statements in your code, to see where it is exactly failing. Be smart when you do this, don’t start adding print statements everywhere in the page. Spread your debug print statements over the page to start with and then start moving down to specific areas.

Hope that helps.