strace helped me find the problem.
# echo "<?php phpinfo() ?>" | strace /opt/php7/bin/php 2>&1 | grep php.ini open("/etc/php7/php.ini/php-cli.ini", O_RDONLY) = -1 ENOTDIR (Not a directory) open("/opt/php7/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/php7/php.ini/php.ini", O_RDONLY) = -1 ENOTDIR (Not a directory)
I do not understand why, but PHP is looking for the wrong folder. It seems that changing with-config-file-path without make clean is causing the problem.
I added --with-config-file-path=/opt/php7/lib to ./configure and --with-config-file-path=/opt/php7/lib make clean && make && make install .
He solved the problem.
source share