Where is the Php. ini file? the Php. ini file cannot be found.

Source: Internet
Author: User
The Phpini file is a configuration file of php. on a windows host, if you haven't modified the configuration file, the phpini file must be in the same directory as your php installation file, but it seems different in linux.

Php. the INI file is a configuration file of php. if you have not modified the configuration file of php on a windows host. the INI file must be in the same directory as your php installation directory, but it seems to be different in linux. next I will introduce how to find php. ini location method.

In linux

The most likely location is the/etc directory or the/usr/local/lib directory.

If you still cannot find the location, use the ultimate solution:

Create a php file and write the following code: Save, visit the page in the browser, and search for php. ini, congratulations, you are looking for php. the INI file location has been found. (use this method to find Php. ini file location, both in linux and windows)

Use the command line/data/php/bin/php a. php | grep php. ini on the linux server

The code is as follows:

  1. Configuration File (php. ini) Path =>/data/php/etc
  2. Loaded Configuration File =>/data/php/bin/php. ini

On a linux server, nginx + php is used.

/Data/php/bin/php. ini permission

-Rwxrwxrwx. 1 root 69737 February 3 13:49/data/php/bin/php. ini

What should I do to view a. php display Loaded Configuration File>/data/php/bin/php. ini in the browser?

What is the main difference between running php commands and browsing php files in a browser?

Php. ini location modification method::

Php. by default, the INI file is placed on/usr/local/lib. you can use the -- with-config-file-path parameter during compilation to modify php. ini storage location. for example, you can use -- with-config-file-path =/etc to store it under/etc, and then copy php from the source package. ini-dist to/etc/php. ini.

Windows

In the php installation folder, there are two similar php. ini-xxxxxxxx. You choose to delete "-xxxxxxxxx.

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.