PDA

View Full Version : php.ini



juc1
2012-09-21, 08:57 AM
Hi all,

Can anyone please tell me why my Debian 6 VPS has three files for php.ini =

/etc/php5/cgi/php.ini

/etc/php5/apache2/php.ini

/etc/php5/cli/php.ini



Thanks

suwunk
2012-09-21, 12:10 PM
Depends how you're using PHP...
-When you're using it from the command line (CLI), it uses the ini from the CLI folder (/etc/php5/cli/php.ini )
-When it's called from the web server (as it is when you're using a browser), it uses the one in the apache2 folder (/etc/php5/apache2/php.ini)
-When you're using it from the CGI, it uses the ini from the CGI folder (/etc/php5/cgi/php.ini)

Cheers

juc1
2012-09-21, 12:25 PM
Depends how you're using PHP...
-When you're using it from the command line (CLI), it uses the ini from the CLI folder (/etc/php5/cli/php.ini )
-When it's called from the web server (as it is when you're using a browser), it uses the one in the apache2 folder (/etc/php5/apache2/php.ini)
-When you're using it from the CGI, it uses the ini from the CGI folder (/etc/php5/cgi/php.ini)

Cheers

Ok thanks so these files can have different values? Anyway to change values (eg post_max_size and upload_max_filesize) for my websites would I edit /etc/php5/apache2/php.ini or /etc/php5/cgi as mentioned by my phpinfo.php (screenshot attached)?

Thanks

101

suwunk
2012-09-21, 06:30 PM
Look for the following entry:

Loaded Configuration File /var/www/vhosts/example.com/etc/php.ini
that is basically where your global php.ini file resides on your system

mithcd
2012-09-27, 02:23 PM
I've been wondering this pretty much myself. This is specially in linux devices. I don't think they are symbolic links either. So if we make some changes, should the global .ini takes care oto all of them? https://imagicon.info/cat/15-33/smile.png