How to find the php.ini file used by the command line?

Amokrane Chentir picture Amokrane Chentir · May 1, 2010 · Viewed 418.2k times · Source

I need to enable pdo_mysql in my EasyPhp environment, so I went to php.ini file and uncommented the following line:

extension=php_pdo_mysql.dll

Unfortunately I still have the same problem. I'm using the CLI so I suppose I need to locate the php.ini file used by the CLI. How can I find it?

Answer

Mchl picture Mchl · Sep 19, 2010

Just run php --ini and look for Loaded Configuration File in output for the location of php.ini used by your CLI