A script is called from command line using :
/fullpath/php -q -c /fullpath/php.ini /fullpath/script.php
I want it to use the normal php.ini and not the one for cli, but the -c flag is not working.
What could cause this ?
A script is called from command line using :
/fullpath/php -q -c /fullpath/php.ini /fullpath/script.php
I want it to use the normal php.ini and not the one for cli, but the -c flag is not working.
What could cause this ?
You can check which configuration files are actually loaded with the
--ini
switch.Here's what my normal configuration looks like:
Yields:
Note that, it loads
php-cli.ini
, because it exists and we are incli
.If we do this:
We get:
This time
php-cli.ini
was not loaded, the specified one was, but so were all the files in scan dir too.Finally, if we do this:
We get:
So, adding the additional switch
-n
, stops PHP from using the scan directory configuration.