Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My php code not working under directory of mod_userdir (~/user) but working fine at /var/www/ , how I can dealing with this problems ? when I open a php file under ~/user my browser prompt to download

share|improve this question
up vote 3 down vote accepted

Please look in /etc/apache2/mods-enabled/php5.conf, it has this comment:

# 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.

After you changed the file, restart Apache with service apache2 restart.

share|improve this answer
Thanks you! this helps! – Smile.Hunter Aug 1 '11 at 11:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.