Apache Prompts to Download PHP

I had just run some simple patching on a test webserver and had some issues with PHP. Ran a few more commands and the problem went away. Until I decided to patch a production server as well.

Basically the update included an apache update, which wrecked the php modules. How do I know this?

Running Ubuntu 10.04.03 LTS
apt-get update
apt-get dist-upgrade
Load website and it prompts to download/save the PHP file instead of displaying the PHP file. Great.

Check if the PHP5 module is activated:
a2enmod php5
apache2ctl restart

Only the restart yielded this:

apache2: Syntax error on line 204 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory

So just install the module libraries for PHP5:
apt-get install libapache2-mod-php5

This should automatically restart apache, but just for good measure you can do it again to verify there are no more errors:
apache2ctl restart

Leave a Reply

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