如何解決 php --ini “已載入設定檔:(無)”?

如何解決 php --ini “已載入設定檔:(無)”?

我正在嘗試從原始程式碼安裝 php,但是我在這裡遇到了問題,我用谷歌搜尋了它,但對我沒有任何用處。首先,這是我的 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

為什麼Loaded Configuration File: (none)是null,是不是安裝的時候出了什麼問題?

也,

$ ls /usr/local/programs/php5/etc/
pear.conf  php.ini  php.ini.bk

答案1

--with-config-file-path=/usr/local/programs/php5/etc/php.ini

是不正確的。您指定一個小路不是一個文件

    --with-config-file-path=/usr/local/programs/php5/etc/

相關內容