Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve php --ini "Loaded Configuration File:(none)"?

Tags:

php

I am trying to install php from source code, but I got a problem here, I googled it but nothing useful for me. First, here is my 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

After the script is done, I got some weird information here:

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

Why Loaded Configuration File: (none) is null, is there anything wrong during the installation ?

Also,

$ ls /usr/local/programs/php5/etc/
pear.conf  php.ini  php.ini.bk
like image 569
user3639650 Avatar asked May 15 '14 07:05

user3639650


People also ask

How do I restore a PHP ini file?

ini file settings to default. You can restore the global php. ini file for your account or the main php. ini files of subdomains to default by using the Restore to default button from the hosting Control Panel -> PHP Settings section.

What is PHP ini configuration file?

The php. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. php.


1 Answers

The problem is:

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

According the configuration help

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

You can see, the value of with-config-file-path should not contains php.ini, it's a directory which contains php.ini in under it, so it should be like this:

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

Another question, why people vote down this question without a reason? except @JimiDini

like image 89
MichaelLuthor Avatar answered Nov 07 '22 06:11

MichaelLuthor