I have Linux Ubuntu 10.10 and when i run the below in a terminal:
php -i | grep php.ini
I got the loaded Configuration File => /etc/php5/cli/php.ini
While if I use phpinfo()
in the browser it will be:
Loaded Configuration File /etc/php5/apache2/php.ini
Which means that there are different ini files according to php_sapi_name!!
now the question is how can i set the same php.ini for all user agents (browser, cli, etc) without copying the same file to different locations!?
Bluehost cPanel's MultiPHP INI Editor allows you to make configuration changes to your PHP settings. This is along with MultiPHP Manager, which gives you a way to change the PHP version of your sites. This article will provide you information on how to edit php.
ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.
The INI file which contains the Program Options is stored in the user's Windows\application_data folder (something like C:\Users\pguth\AppData\Roaming\microdem\microdem. ini) .
I don't think setting all the different php contexts to use the same config is a good idea in the first place but if you really want to, you could just have one php.ini and all the others be symbolic links.
I don't think there is a way to change php's behavior as to which file it will include without at the very least recompiling it.
sometimes you can have more than one php.ini to manage different interfaces or websites for example you can have different php.ini for each website you host on your server by setting PHPINIDir in your virtualhost as below
<VirtualHost 10.24.11.2:80> ServerName foo.com ServerAlias www.foo.com PHPINIDir /var/www/html/foo </VirtualHost>
however, if you like to make only one php.ini for all interfaces, the only way is to use symlinks as below:
ln -s /etc/php5/cli/php.ini /etc/php5/apache2/php.ini
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With