Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

Hope that helps you.

McX

share|improve this answer
    
Thank you - You're right. Looking at 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

Your Answer

 
discard

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.