Reprinted from: http://www.php100.com/html/php/rumen/2013/0831/26.html
[Guide] PHP INI file is a PHP configuration file, in the Windows host if you have not modified the configuration file PHP ini file must be with your PHP installation directory together, but it seems different in Linux, I would like to introduce the way to find the PHP ini location.
php.ini file is a PHP configuration file, in the Windows host if you have not modified the configuration file PHP.ini file must be with your PHP installation directory together, but it seems different in Linux, let me describe the way to find php.ini location. Under Linux
The most likely location is under the/etc directory or in the/usr/local/lib directory.
If you still can't find a location, then use the ultimate solution:
Create a new PHP file, write the following code to save, and then in the browser to access the page, search php.ini, congratulations, you are looking for the php.ini file location has been found. (Use this method to find php.ini file location, under Linux and Windows are the trick OH)
Using the command line/data/php/bin/php a.php on a Linux server | grep php.ini
Show
View Source print?
1.
Configuration File (php.ini) Path => /data/php/etc
2.
Loaded Configuration File => /data/php/bin/php.ini
/data/php/bin/php.ini permissions on the Linux server are nginx+php
-rwxrwxrwx. 1 root root 69737 February 3 13:49/data/php/bin/php.ini
What to do to navigate in the browser a.php display loaded Configuration File =/data/php/bin/php.ini
What are the main differences between the PHP command line and the PHP file in the browser?
The php.ini location modification method is as follows:
The php.ini file is placed by default on the/usr/local/lib, and you can use the--with-config-file-path parameter at compile time to modify the location of the php.ini, for example, you can use--with- CONFIG-FILE-PATH=/ETC store it under/etc, and then copy the Php.ini-dist to/etc/php.ini from the source package.
Windows
In the PHP installation folder.
A total of two similar php.ini-xxxxxxxx. You choose one you put "-xxxxxxxxx" Delete is to use this.
php.ini file location where php.ini file not found