On a ubuntu-10.04 and Apache2 I am trying to disable PHP execution on /var/www/upload directory. So I've added the following to /etc/apache2/sites-enabled/000-default:

< Directory /var/www/upload/> AddType text/plain .php < /Directory>

Then of course I've restarted the Apache2 service.

However, according to my tests, PHP is still being executed on the upload directory.

Anyone knows what I'm missing here?

migrated from superuser.com Jul 18 '11 at 22:42

This question came from our site for computer enthusiasts and power users.

  • 1
    What happens if you chmod -R a-x /var/www/upload/* ? (Remove execute permission on all files in /var/www/upload ? – Darth Android Jul 18 '11 at 16:49
  • Yes that's a solution :) , but I'd like to do that from Apache configuration. I've been fighting with this for a couple of hours and still nothing :/ – lisa1987 Jul 18 '11 at 17:13
  • Are you a sysadmin or is this site a home computer? – random Jul 18 '11 at 20:49
  • It's a Virtual Machine I'm testing on – lisa1987 Jul 18 '11 at 21:49

Try using the apache directive 'RemoveHandler' in directory context,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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