Two methods for php to find the path where the php configuration file php.ini is located

Usually the location of php.ini is:

     In the /etc directory or /usr/local/lib.

If you still can't find php.ini or find php.ini and the modification does not take effect (in fact, you didn't find the right one), please use the following methods:

1. Create a new php file and write the following code

<?phpecho phpinfo();

Then visit the page in the browser, search for php.ini,

2. Execute, (you need to modify php to your own path)
[code]/usr/local/php/bin/php --ini
will show the path where php.ini is located, which path does not have a php.ini file,

Configuration File (php.ini) Path: /usr/local/php/lib
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)

 

The method for modifying the location of php.ini is as follows: The php.ini file is placed on /usr/local/lib by default.

You can use the --with-config-file-path parameter to modify the storage location of php.ini during compilation.

For example,
you can use --with-config-file-path=/etc
to store php.ini under /etc, and then copy php.ini-dist from the source package to /etc/php.ini.

from:http://www.jb51.net/article/50406.htm

Guess you like

Origin blog.csdn.net/haojiao730/article/details/113028308