php -i | grep Load
Loaded Configuration File => (none)
libXML Loaded Version => 20901
解决办法:
使用strace去追踪一下:
#strace /usr/local/php/bin/php -i 2> /tmp/1.log
grep ‘php.ini‘ /tmp/1.log 显示如下信息:
open("/usr/local/php-7.0.23/bin/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/php/etc/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/php-7.0.23/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/php/etc/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/php/etc/php.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
把php.ini复制到/usr/local/php-7.0.23/bin/下,然后配置文件加载成功了。
#cp /usr/local/php-7.0.23/etc/php.ini /usr/local/php-7.0.23/bin/
原文:http://blog.51cto.com/13581826/2322745