When attempting to enable extensions for PHP in a command line environment, it's essential to locate the correct php.ini file. Unlike EasyPHP's graphical interface, the CLI requires a specific approach to find this file.
To resolve this issue, execute the following command in your terminal:
php --ini
The output will display various information, including the location of the php.ini file used by the CLI. Look for the line that says "Loaded Configuration File" and the path listed beside it. That is the php.ini you need to adjust, allowing you to enable extensions like pdo_mysql for your command line scripts.
The above is the detailed content of Where is my php.ini file for command-line PHP?. For more information, please follow other related articles on the PHP Chinese website!