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.

I want to lock my php configuration and disable loading other php configurations rather than the default (which in my case is located at /usr/local/php/lib/php.ini) I want to disable the "Scan this dir for aditional.ini" or if there's a way to set the vars from php.ini as permanent I would go for it.

Any suggestions ?

Thanks in advance,
Me.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

In order to do this you need to recompile php and remove the option --with-config-file-scan-dir=/whateverdir/php.d

share|improve this answer
    
Thanks! That did it! :) –  tftd Jan 20 '11 at 23:06

As an alternative that doesn't require recompiling PHP, you can set the PHP_INI_SCAN_DIR environment variable. If you are using PHP as an Apache module, you may add something like this to the Apache configuration file in which the PHP module is loaded:

SetEnv PHP_INI_SCAN_DIR /usr/local/zend/etc/conf.d/

If using CGI/FastCGI you can also use the -n -c command switches as noted here:

https://bugs.php.net/bug.php?id=45114

share|improve this answer
2  
Much better solution. I'd rather use the system packages than recompile and manage it myself. –  Matthew Scharley Sep 12 '11 at 3:20
    
This actually doesn't work when PHP is running as an Apache SAPI module. –  Socio Nov 8 '12 at 9:53
    
It certainly does work, you just need to make sure your server has mod_env enabled and available for your use. –  Dave Forgac Nov 8 '12 at 14:15
    
I dont know how to do it man... its not working... –  Raheel Hasan Nov 25 '13 at 12:38
    
I added the environ var in the system, but still its not loading.. –  Raheel Hasan Nov 25 '13 at 12:38

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.