Linux php.ini file Location view command

Source: Internet
Author: User

Sometimes we run into this situation: don't know where the PHP profile currently running is php.ini
This time, use the following command

The code is as follows Copy Code

Strace-o php.log-s 65535 php-i then search the INI in the output result file Php.log

The possible output results are:

Open ("/usr/bin/php-cli.ini", o_rdonly) =-1 enoent (No such file or directory)
Open ("/etc/php-cli.ini", o_rdonly) =-1 enoent (No such file or directory)
Open ("/usr/bin/php.ini", o_rdonly) =-1 enoent (No such file or directory)
Open ("/etc/php.ini", o_rdonly) as above, ultimately positioned to/etc/php.ini

Strace This command is especially useful when tracking the execution of a program, and this command deserves further study.

Add:

The commands for how to find files under Linux are:

Find/File name to look for-print

So we can use this command to quickly find the php.ini file and modify it.

The code is as follows Copy Code

Find/php.ini-print

Using the command line on a Linux server

The code is as follows Copy Code

/data/php/bin/php a.php | grep php.ini
Show

Configuration File (php.ini) Path =>/data/php/etc

Loaded Configuration File =>/data/php/bin/php.ini

/data/php/bin/php.ini permissions The Linux server uses the 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

Looking up the php.ini directory under Windows is very simple is that you have installed the PHP directory of php.ini-**** files, if the first installation we need to change a php.ini oh.

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: 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.