Two methods for finding the path of the php configuration file php. ini _ php skills

Source: Internet
Author: User
This article mainly describes how to find the php configuration file php. there are two methods for ini path. many users cannot find php after installing php. ini, or an environment installed by others. The method in this article is simple and practical. if you need it, you can refer to php. the ini is located:

The code is as follows:

/Etc directory or/usr/local/lib directory.

If you still cannot find php. ini or find the php. ini modification that does not take effect (in fact, it is not correct), use the following method:

1. create a php file and write the following code

The code is as follows:

Echo phpinfo ();

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

The path where php. ini is located and which path does not contain the php. ini file is displayed,

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 php. ini location is modified as follows: the php. ini file is put 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
Store php. ini under/etc, and copy php. ini-dist from the source package to/etc/php. ini.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.