How to find php.ini location on CentOS server ?

How to find php.ini location on CentOS server ?

What is php.ini file ?
The php.ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits.

How to find php.ini location ?
You can check php.ini file through two ways.

1). Through php file using phpinfo() function : You can check php.ini file by putting a php file in web server root directory and put this code in it :
-------
<?php
phpinfo();
?>

-------

2) Through command line : You can check php.ini location using this commmand.
-----
# php -i|grep php.ini
-----

This will give output like :
-----
Configuration File (php.ini) Path => /etc/apache2/php.ini
-----
Author
bhawanisingh
Views
10,327
First release
Last update
Rating
0.00 star(s) 0 ratings
Top