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.
That was very helpful; I’d been trying to figure this issue out for nearly an hour before I stumbled upon your site.
Thanks
Thats why I posted it. I’m glad it helped you fix it instead of taking many hours more.
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…
Thanks a lot.
damn packagers, they ruin everything
I love you! I’ve been scouring all over the internet looking for this bugger! Like I somehow had php running correctly one one of my vhosts but when my client wanted to get add more sites, I ran into this problem again.. Darn just knew it had to be a bug with the version of Ubuntu!
After long search and a lot of tries, this worked for my sandbox vserver as well. Glad I don’t have to bother our admin again. :)
Thanks a lot guys. Good job.