I have this strange and stupid problem I'm trying to resolve for a couple of hours now. I have installed apache 2.2.10 (it was compiled from source a long time ago), and PHP-5.3.6. Both are working just great except for the fact I can't get PHP to load the php.ini file.
This is my config.nice file:
'./configure' \
'--prefix=/usr/local/php-5.3.6' \
'--with-config-file-path=/usr/local/php-5.3.6/lib' \
'--with-apxs2=/usr/local/apache-2.2.10/bin/apxs' \
'--with-curl' \
'--with-mysql' \
'--with-zlib' \
'--with-bz2' \
'--with-gd' \
'--with-jpeg-dir' \
'--with-png-dir' \
'--enable-mbstring' \
'--with-freetype-dir' \
'--with-t1lib' \
'--enable-gd-native-ttf' \
'--enable-gd-jis-conv' \
'--with-openssl' \
'--with-openssl-dir' \
'--enable-pcntl' \
"$@"
I've used this config.nice for all the PHP versions since 5.2 with slight changes and it is working this way on a couple of servers. It's probably something small I'm missing and I can't figure what it is.
I set the '--with-config-file-path' because I though php can't find it's own path or something. In the defined path I have a file called php.ini which is copied from the PHP 5.3.6 tarball (php.ini-development).
The file should be working as it's the original but I can't see because it's not loading - phpinfo() returns:
Configuration File (php.ini) Path:
/usr/local/php-5.3.6/lib
Loaded Configuration File:
(none)
Does anybody have an idea what may be the problem ?
Relevant info:
@Server OS: Slackware 12.2
@Apache Version: 2.2.10
@Apache User / Group: daemon / daemon
@PHP Version: 5.3.6 (Latest)
@PHP ini file: /usr/local/php-5.3.6/lib/php.ini
@PHP ini file perms: 777 (daemon.daemon)
I'm guessing the file isn't actually there or there is a permissions problem. I'd run
echo "<?php phpinfo() ?>" | strace php 2>&1 | grep php.ini
to see what is happening.For people who still couldn't get this resolved: In my case, it was SELinux permissions that was preventing PHP loading php.ini. Changing the context for the php.ini file with the following commands did the trick: