0

This is a question about PHP configuration on a LAMP server.

I want to turn off allow_url_fopen on one virtual host but not the other (i.e. can't turn it off globally in php.ini). The other day I had the same requirement but with register_globals and it was easy, I just added the following to the .htaccess file in the DOCUMENT_ROOT of the virtual host:

php_flag register_globals 0

But the same doesn't seem to work for allow_url_fopen. If I add

php_flag allow_url_fopen 0

to my .htaccess nothing happens phpinfo() shows local value On, global value On.

What am I doing wrong?

PS: I restarted Apache after modifying the .htaccess file.

Tom
  • 4,277
  • 11
  • 42
  • 52

1 Answers1

1

There are flags that are PHP_INI_SYSTEM. That means you can change their value only in php.ini.

Hope that helps you.

McX

  • Thank you - You're right. Looking at http://www.php.net/manual/en/ini.list.php I can see the allow_url_fopen option is marked as "PHP_INI_SYSTEM" for my version of PHP which means I can't change it in a .htaccess file, only the php.ini. – Tom Oct 27 '09 at 12:16