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?
There is no php.ini used by the command line. You have to copy the file from
...EasyPHP-<<version>>\apache\php.ini
to...EasyPHP-<<version>>\php\php.ini
than edit the one in php directoryReference:
Run
php --ini
in your terminal, you'll get all details about ini filesFor more, use helping command
php --help
It'll display all the possible options.If you want all the configuration files loaded, this is will tell you:
Some systems load things from more than one ini file. On my ubuntu system, it looks like this:
On OSX Mavericks, running:
Returned:
In the
/etc/
directory was:(as well as
php-fpm.conf.default
)I was able to copy
php.ini.default
tophp.ini
, adddate.timezone = "US/Central"
to the top (right below[php]
), and the problem is solved.(At least the error message is gone.)
Somtimes things aren't always as they seem when in comes to config files in general. So here I'm applying my usual methods for exploring what files are opened by a process.
I use a very powerful and useful command-line program called strace to show me what's really going on behind my back!
Strace digs out kernel (system) calls that your program makes and dumps the output into the file specified by -o
It's easy to use grep to search for occurrences of php.ini in this log. It's pretty obvious looking at the following typical response to see what is going on.
From what I remember when I used to use EasyPHP, the php.ini file is either in
C:\Windows\
orC:\Windows\System32