Home  >  Article  >  Backend Development  >  Two methods to find the path where the php configuration file php.ini is located_PHP Tutorial

Two methods to find the path where the php configuration file php.ini is located_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:29:24796browse

Usually the location of php.ini is:

Copy the code The code is as follows:
/etc directory or /usr/local/ lib directory.

If you still cannot find php.ini or if you find php.ini and the modification does not take effect (in fact, you did not find it correctly), please use the following method:

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

Copy the code The code is as follows:

echo phpinfo();
[code]

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

2. Execute, (you need to modify php to your own path)
[code]/usr/local/php/bin/php --ini


will display the path where php.ini is located. There is no php.ini file in which path,
Copy the code The code is as follows:
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 to modify 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 during compilation to modify the storage location of php.ini.

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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/776763.htmlTechArticleUsually the location of php.ini is: Copy the code as follows: /etc directory or /usr/local/lib directory. If you still can't find php.ini or if you find php.ini, the modification will not take effect (actually it doesn't...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn