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?
Just run
php --ini
Do
This will output all files named
php.ini
.Find out which one you're using, usually
apache2/php.ini
In your php.ini file set your extension directory, e.g:
You will see in you PHP folder there is an ext folder with all the dll's and extensions.
will give you all the details details on the uses path and possible ini file(s)
You can use get_cfg_var('cfg_file_path') for that:
Unlike phpinfo() it will tell if it didn't find/use a php.ini at all.And you can simply set the location of the php.ini. You're using the command line version, so using the
-c
parameter you can specifiy the location, e.g.If you need to pass it to another app, you can do something like:
returns the path only.
php -c $(php --ini | grep Loaded | cut -d" " -f12)
will pass in the config file (useful forfpm
)