Saturday, July 31, 2010

How to Re-enable PHP in User Directories, and Thanks for Nothing, Lucid >:-p

Nothing about the Apache web server works quite the same way on Debian Linux or its descendents (such as Ubuntu 10.04, the Lucid Lynx) as it would on Unix or normal, benighted Linuxes like Red Hat. So, for example, when I updated from Jaunty to Lucid, my Apache 2.2 PHP module busted and some of my favorite scripts (i.e, the ones whose names end with ".php") would no longer run.

The fix was easy; I just commented out the indicated lines in /etc/apache2/mods_enabled/php5.conf, and everything works again! The trick was finding any file that even mentions "re-enabling php..." (Sheesh, I'd RTFM if it were as up to date as the software it's supposed to document!)

dave@Skoojewa:/etc/apache2/mods-enabled$ cat php5.conf
<ifmodule mod_php5.c>
<filesmatch "\.ph(p3?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<filesmatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
# To re-enable php in user directories comment the following lines
# (from <ifmodule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
### commented out 7/31/2010 dco
###<ifmodule mod_userdir.c>
### <directory /home/*/public_html>
### php_admin_value engine Off
### </Directory>
###</IfModule>

</IfModule>

Still, I do wonder what happened to apache2-mpm-prefork... Documentation? What documentation? "The code is obvious."

Or not.

Labels: ,

2 Comments:

Anonymous Anonymous said...

Thanks, just ran into the same issue.

10:22 PM  
Anonymous Anonymous said...

Thanks, you resolved my problem under Debian squeeze.

12:38 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home