I am setting up an Ubuntu 12.04 server with a LAMP stack on a VPS for the very first time.

My problem is that Apache refuses to show PHP pages I upload to the server, there's just a blank page. The strange thing is that PHP pages that I create locally on the server works fine. So for example if I make a file phpinfo.php with nano containing the following:

<?php phpinfo(); ?>

it shows up fine in my browser. But if I create the exact same file on my local computer and uploads it to the server it is just blank in the browser.

Server is Ubuntu 12.04 and locally I'm running Windows. Error logs show nothing.

I suspect there's some sort of file association error. When I use file -i command on my uploaded files they show mime type (second column) to be text/x-php but on the locally produced files it says text/plain. I suspect this could be causing the malfunctioning. However, I do not know how to make Apache accept the text/x-pdf files. I've been messing around with different mime-type files without anything really happening. It should also be noted that I am new to Linux. Some guidance would be much appreciated.


This issue could be your apache handler. Please check if you have added php handler into you apache configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.