Allow using php_value and php_flag in .htaccess

.htaccessapache-2.2php.ini

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
</Directory>

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?

Best Answer

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.