Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

easyphp

I need to enable pdo_mysql in my EasyPHP environment, so I went to the 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?

like image 831
Amokrane Chentir Avatar asked May 01 '10 15:05

Amokrane Chentir


People also ask

How do I know which PHP ini is being used?

Check php. ini in CLI (Command Line Interface): To know about php. ini, simply run on CLI. It look for Loaded Configuration File in output for the location of php.

Where is PHP ini for CLI?

ini is usually located in /etc/php/8.1/apache2/php. ini . Replace 8.1 with your own version, e.g, php5. 6 , php7.

Where is my PHP ini file Linux?

The default location for the php. ini file is: Ubuntu 16.04: /etc/php/7.0/apache2. CentOS 7: /etc/php.

Where are my PHP files located?

The files are in the host file system (the Linux file system if you are using Linux of course). The Apache config maps to a directory, commonly through the use of a VirtualHost setting.


1 Answers

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

like image 78
Mchl Avatar answered Sep 23 '22 05:09

Mchl