学会用strace:
strace -o php.log -s 65535 php -i
然后在 php.log 中找ini:
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)
这样就很容易定位配置文件了,strace 是解决类似问题的万能钥匙。 类似的工具还有lsof,tcpdump.
目前只用过strace -p 1212