blank php pages – mystified?

A common problem with php applications is the inscrutable blank page. No matter what you do, nothing shows on the page, nothing shows in the apache error logs, nothing in the syslog.. you try a phpinfo page and that works fine, you do a “hello world” page and that works fine.. so what is causing your fancy dynamic php site to show blank pages everywhere??

Well quite often the reason is simply database connection issues – if your app uses mysql, did you install php-mysql on your server? A quick check on redhat/centos servers can be done like so..

rpm -qa | grep mysql

Do you see anything like “php-mysql” in the list? If not then thats your problem.. fix like so..

yum install php-mysql

Then restart apache and off you go.

If it is installed then check your db connection params – db user/pass/hostname/dbname in your code and access permissions in mysql. For a dev server (not when its open to the public!) you may want to switch on display_errors in your php.ini file which can help debugging.




You may also like...