10

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.

tftd
  • 1,480
  • 7
  • 24
  • 38

2 Answers2

22

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

Dave Forgac
  • 3,486
  • 7
  • 36
  • 48
10

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

lynxman
  • 9,157
  • 3
  • 24
  • 28