Re-enabling PHP in User Directories in Ubuntu 10.04

If you happen to develop PHP applications in ~/pubic_html instead of in /var/www and you have just upgraded to Ubuntu 10.04 (Lucid Lynx), you will be surprised that your PHP applications are not working anymore and your browser just prompts you to download something.

It turns out that the following lines were added to /etc/apache2/mods-enabled/php5.conf.

    # 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.
    <IfModule mod_userdir.c>
        <Directory /home/*/public_html>
            php_admin_value engine Off
        </Directory>
    </IfModule>

Follow the instructions in the comments and restart Apache. Your PHP applications will be back to normal again.

15 thoughts on “Re-enabling PHP in User Directories in Ubuntu 10.04”

  1. Arrrgh! Nothing like getting sucker-punched when you upgrade. Thanks for finding this. You saved me hours of frustration.

  2. I have this problem, but I am trying to enable apache2 userdir ‘s. what should be there instead? You told me the problem, and no solution.

  3. Thanks a lot man, you saved me from hell. I spend some good f**g hours for searching this one.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>