Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is php.ini and where it is located in CentOS [closed]

Tags:

php

I am new to php. I installed php on my CentOS 6.2 machine. I have added an extension but when I install it I get a warning that I should add "extension=mongo.so" to php.ini.I cannot find php.ini. Just above that there is a warning that php_ini is not set to php.ini location. So php doesn't even know where it is. What is php.ini and where should it be located?

like image 222
Kevin Burton Avatar asked Dec 12 '12 02:12

Kevin Burton


People also ask

Where is PHP ini file in CentOS?

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

Where is PHP ini file Linux?

ini is usually located in /etc/php/8.1/fpm/php.

How do I open a PHP ini file in Linux?

The path of php. ini in Ubuntu is /etc/php5/apache2 . Open the terminal and start typing following commands. To view the files present in apache2 directory, type ls command.

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.


1 Answers

You can confirm php.ini location by phpinfo();. In my centos, I found as follows.

Configuration File (php.ini) Path => /etc

In most Linux, php.ini seems to be located at "/etc/php.ini"

like image 62
akiniwa Avatar answered Sep 21 '22 16:09

akiniwa