I am running an Apache web server with PHP5 as a module (notice: as an Apache module, not CGI!).

In some of my .htaccess files (the one that comes with the gallery3 software, http://gallery.menalto.com/), there are php_value and php_flag statements.

They cause a 500 server error when trying to access files in that folder. So I edited my apache2.conf and added these lines:

<Directory /my/gallery/folder>
  AllowOverride All

Did I do anything wrong? I allow overriding, I run PHP as an Apache module. Why keeps the error.log telling me php_value not allowed here?

  • If you have access to the main Apache configuration why would be using htaccess files? Just put your directives in the main configuration file. – Zoredache Sep 15 '11 at 18:26
  • 2
    I can, I would, but this isn't the solution. The software comes with the .htaccess configuration (and will overwrite the .htaccess with every update), so this is an upstream thing. I don't want to maintain this with every update. – tvooo Sep 15 '11 at 19:02

Try to add the "Directory" directive inside the virtualhost rather than in the default apache2.conf. Also if this is in ubuntu/debian, you will need to make the changes in /etc/apache2/sites-available/default , if you are not using any additional virtualhosts.


If you are using XAMPP for and bended your DocumentRoot to /Users/USERNAME/Sites there is a second apache configuration file to take care of:


It defines the AllowOverride Settings for /Users/*/Sites with

AllowOverride FileInfo AuthConfig Limit Indexes

Maybe this hint works for other AMP-stacks too.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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