php.ini file location where php.ini file not found

Source: Internet
Author: User

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

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: info-contact@alibabacloud.com 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.