Menu Close

apache/php, serving php files for download instead of executing them

I have seen a couple of threads like this, but they were not very helpful.

My problem is: When I try to execute my php files in my browser from my ubuntu hardy server, the browser offers to download the files instead of the server proccessing them.

whats worse the file it allows me to download is not the proccessed output but the “code” file. these files could have database name, password and what not. Not so good!!!

For some reason though, my webmin works. (probably because its https and not http)

First off all, it has worked before. I haven’t used it for quite a while, but resently i updated webmin to version 1.500 (dont know if this is the reason for my problems), but I just noticed problems after the update.

The solution is:

first, install libapache2-mod-php5

sudo apt-get install libapache2-mod-php5

Then enable it

sudo a2enmod php5

Restart apache

sudo service apache2 restart


Clear your cache on your browser, and re-load the page.



Posted in News, Web Development

Leave a Reply

Your email address will not be published. Required fields are marked *