There are multiple ways to find the location of php.ini on your linux os.
If you don't have access to command line the best way to find this is: create a php file and add the following code:
and open it in browser, it will show the file which is actually being read!
On the command line execute:
You will get something like:
Few more commands:
You should see something like:
p.s. To get only the php.ini path
If you don't have access to command line the best way to find this is: create a php file and add the following code:
Code:
<?php phpinfo(); ?>
On the command line execute:
Code:
php --ini
Code:
Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d Additional .ini files parsed: /etc/php5/cli/conf.d/curl.ini, /etc/php5/cli/conf.d/pdo.ini, /etc/php5/cli/conf.d/pdo_sqlite.ini, /etc/php5/cli/conf.d/sqlite.ini, /etc/php5/cli/conf.d/sqlite3.ini, /etc/php5/cli/conf.d/xdebug.ini, /etc/php5/cli/conf.d/xsl.ini
Few more commands:
Code:
php -i | grep 'php.ini'
Code:
Loaded Configuration File => /usr/local/lib/php.ini
Code:
php -i | grep /.+/php.ini -oE
Code:
php -r "phpinfo();" | grep php.ini
Code:
find / -name php.ini