Skip to content

Instantly share code, notes, and snippets.

@luxixing
Created November 12, 2013 09:18
Show Gist options
  • Save luxixing/7427923 to your computer and use it in GitHub Desktop.
Save luxixing/7427923 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.

@wenjun1055
Copy link

目前只用过strace -p 1212

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