Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wenjun1055/8035619 to your computer and use it in GitHub Desktop.
Save wenjun1055/8035619 to your computer and use it in GitHub Desktop.

学会用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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment