Home > Backend Development > PHP Tutorial > How to check the path of the php configuration file php.ini?

How to check the path of the php configuration file php.ini?

WBOY
Release: 2016-07-25 09:12:07
Original
1249 people have browsed it

Tell you two ways to find the path of the php configuration file php.ini.

Usually the location of php.ini is:

/etc directory or /usr/local/lib directory.
If you still can’t find php.ini or if you find php.ini and the modification does not take effect (in fact, you didn’t find it correctly), please use the following method:
1. Create a new php file and write the following code

  1. echo phpinfo();
Copy code

Then visit the page in the browser and search for php.ini. The environment variable results in the phpinfo function are used.

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

The path where php.ini is located will be displayed. Which path does not contain the php.ini file?

  1. Configuration File (php.ini) Path: /usr/local/php/lib
  2. Loaded Configuration File: (none)
  3. Scan for additional .ini files in: (none)
  4. Additional .ini files parsed: (none )
Copy code

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.

All roads lead to Rome. When searching for the location of the php.ini file, you can refer to one of the above two methods, both of which can achieve your needs.



source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template