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.