command line interface - php cli custom ini not loading -


a script called command line using :

/fullpath/php -q -c /fullpath/php.ini /fullpath/script.php 

i want use normal php.ini , not 1 cli, -c flag not working.

what cause ?

you can check configuration files loaded --ini switch.

here's normal configuration looks like:

krakjoe@fiji:/usr/src/php-src$ php --ini 

yields:

configuration file (php.ini) path: /etc loaded configuration file:         /etc/php-cli.ini scan additional .ini files in: /etc/php.d additional .ini files parsed:      /etc/php.d/apcu.ini, /etc/php.d/auto.ini, /etc/php.d/autostrict.ini, /etc/php.d/ds.ini, /etc/php.d/inspector.ini, /etc/php.d/memcached.ini, /etc/php.d/mongodb.ini, /etc/php.d/mysql.ini, /etc/php.d/opcache.ini, /etc/php.d/pdo.ini, /etc/php.d/uopz.ini, /etc/php.d/xdebug.ini, /etc/php.d/yaml.ini 

note that, loads php-cli.ini, because exists , in cli.

if this:

krakjoe@fiji:/usr/src/php-src$ php -c php.ini-development --ini 

we get:

configuration file (php.ini) path: /etc loaded configuration file:         /usr/src/php-src/php.ini-development scan additional .ini files in: /etc/php.d additional .ini files parsed:      /etc/php.d/apcu.ini, /etc/php.d/auto.ini, /etc/php.d/autostrict.ini, /etc/php.d/ds.ini, /etc/php.d/inspector.ini, /etc/php.d/memcached.ini, /etc/php.d/mongodb.ini, /etc/php.d/mysql.ini, /etc/php.d/opcache.ini, /etc/php.d/pdo.ini, /etc/php.d/uopz.ini, /etc/php.d/xdebug.ini, /etc/php.d/yaml.ini 

this time php-cli.ini not loaded, specified 1 was, files in scan dir too.

finally, if this:

krakjoe@fiji:/usr/src/php-src$ php -c php.ini-development -n --ini 

we get:

configuration file (php.ini) path: /etc loaded configuration file:         /usr/src/php-src/php.ini-development scan additional .ini files in: (none) additional .ini files parsed:      (none) 

so, adding additional switch -n, stops php using scan directory configuration.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -