Saturday, June 5, 2010

Ubuntu - LAMP php5 userdir

So you migrated your primary webserver to Ubuntu LTS and suddenly your users are complaining that their userdir php pages are not working. They keep being asked to download their php pages or phtml, or whatever. Their user blogs are not working. You have unhappy users, and by this time you are probably one as well.

This may have come up in an earlier upgrade, but whether it is 9.10-10.04 or 8.04lts-10.04lts only is pretty irrelevant. You're feeling the pain.

You have two choices. Tell your users to move to a dedicated hosting environment of their own, or re-enable php scripting in the apache web server.


Code:
sudo nano /etc/apache2/mods-available/php5.conf

Look for the lines that look like:
Code:
    <IfModule mod_userdir.c>
        <Directory /home/*/public_html>
            php_admin_value engine Off
        </Directory>
    </IfModule>
and change or comment the following lines to look like:
Code:
#    <IfModule mod_userdir.c>
#        <Directory /home/*/public_html>
#            php_admin_value engine Off
#        </Directory>
#    </IfModule>
then restart apache. 
Code:
sudo /etc/init.d/apache2 restart

And tell your users that they may need to restart their browsers. (or if they can figure out how, clear their web cache.)

No comments:

Post a Comment