PHP Not Parsing on Debian / Ubuntu server with Apache2
My friend Marshall was recently having issues getting PHP5 installed and working on his Ubuntu server, which is a Debian based distribution.
We updated all the packages involved…Apache2, php5, libapache2-mod-php5, made sure the module was installed, restarted Apache2, etc. Nothing worked.
It turns out that the default php5.conf configuration for Debian / Ubuntu’s packages are using an incorrect syntax. Edit /etc/apache2/mods-available/php5.conf to reflect:
<FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>
…instead of…
AddType application/x-httpd-php .php
Special thanks to this Apache wiki article for pointing this out:
http://wiki.apache.org/httpd/DebianPHP
I’m just posting this solution here for all the other nerds having the same issue that aren’t finding this article in Google.
June 22nd, 2010 at 11:14 pm
That was very helpful; I’d been trying to figure this issue out for nearly an hour before I stumbled upon your site.
Thanks
June 25th, 2010 at 1:56 am
Thats why I posted it. I’m glad it helped you fix it instead of taking many hours more.
August 15th, 2010 at 12:59 am
Thank you very much! I have been tearing my hair out for hours (not to mention uninstalling and reinstalling software) trying to work this out and although your solution didn’t exactly match my problem, it told me where I should be looking. Pretty straightforward from there. Now if only Google would return this higher up in its results instead of 20 sites giving the same installation instructions…