如何解决php –ini“加载配置文件:(无)”?

前端之家收集整理的这篇文章主要介绍了如何解决php –ini“加载配置文件:(无)”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图从源代码安装 PHP,但我在这里遇到了问题,
我用Google搜索,但对我没用.
首先,这是我的install.sh
make clean

./configure \
        --prefix=/usr/local/programs/PHP5 \
        --disable-fileinfo \
        --with-config-file-path=/usr/local/programs/PHP5/etc/PHP.ini \
        --with-config-file-scan-dir=/usr/local/programs/PHP5/etc/ \
        --with-apxs2=/usr/local/programs/apache2.4/bin/apxs

if [  0 != $? ]; then
        echo "Auto installation Failed! -- Configuration"
        exit
fi

make
if [  0 != $? ]; then
        echo "Auto installation Failed! -- Make"
        exit
fi

sudo make install
if [  0 != $? ]; then
        echo "Auto installation Failed! -- Configuration"
        exit
fi

echo "Copying the min size config file."
sudo cp PHP.ini.clean.bk /usr/local/programs/PHP5/etc/PHP.ini

if [ -a /usr/bin/PHP ]; then
        sudo rm /usr/bin/PHP
        sudo ln -s /usr/local/programs/PHP5/bin/PHP /usr/bin/PHP
fi

PHP --version
PHP --ini

脚本完成后,我在这里得到了一些奇怪的信息:

Configuration File (PHP.ini) Path: /usr/local/programs/PHP5/etc/PHP.ini
Loaded Configuration File:         (none)
Scan for additional .ini files in: /usr/local/programs/PHP5/etc/
Additional .ini files parsed:      /usr/local/programs/PHP5/etc/PHP.ini

为什么加载配置文件:(无)为空,安装过程中有什么问题?

也,

$ls /usr/local/programs/PHP5/etc/
pear.conf  PHP.ini  PHP.ini.bk
问题是:
--with-config-file-path=/usr/local/programs/PHP5/etc/PHP.ini

根据配置帮助

--with-config-file-path=PATH
                          Set the path in which to look for PHP.ini [PREFIX/lib]

你可以看到,with-config-file-path的值不应该包含PHP.ini,
它是一个包含PHP.ini的目录,所以它应该是这样的:

–with-配置文件中路径= / USR /本地/方案/ PHP5 /等

另一个问题,人们为什么没有理由拒绝这个问题呢?除了@JimiDini

猜你在找的PHP相关文章