php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41497 php.ini not loaded
Submitted: 2007-05-25 11:46 UTC Modified: 2007-06-20 16:28 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dbjh at gmx dot net Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.2.2 OS: RHEL 4
Private report: No CVE-ID: None
 [2007-05-25 11:46 UTC] dbjh at gmx dot net
Description:
------------
Problem: 
php.ini won't be loaded from /etc. When I set PHPIniDir in 
httpd.conf to /etc it still won't be loaded (judged from the output 
of php_info()). 
 
Workaround: 
When I set PHPIniDir to /etc/php/ and put php.ini in that directory 
it is loaded. Another workaround is putting php.ini in /etc/php.d/. 
In the latter case php_info() reports "(none)" at "Loaded 
Configuration File", but is mentioned at "additional .ini files 
parsed". Looking at other output of php_info() it is clear that it 
really is loaded. 
 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-25 13:25 UTC] dbjh at gmx dot net
The problem is also present on RHEL 5. The same workaround can be 
used. 
I meant phpinfo(), not php_info().
 [2007-05-25 17:34 UTC] sniper@php.net
You've just used wrong configuration options. Please check "./configure --help" for more information. Note: all ini related options expect PATH to be passed, without the php.ini. (NOT full-path!)
 [2007-05-25 18:09 UTC] dbjh at gmx dot net
Please read the description before closing the bug report. I've used the same options in combination with PHP 5.2.0. No problem whatsoever. So, your answer is completely inappropriate.
 [2007-05-25 19:18 UTC] dbjh at gmx dot net
I should add that PHP 5.2.0 worked without problems on Fedora Core 4. I just compiled PHP 5.2.2 on Fedora Core 4 and there the problem doesn't show up.
 [2007-05-25 19:30 UTC] dbjh at gmx dot net
Last message before I start looking at source code. On both Fedora Core 4 and Red Hat Enterprise Linux (4 & 5) I used the configure options '--with-config-file-path=/etc' and '--with-config-file-scan-dir=/etc/php.d'.
 [2007-05-25 23:05 UTC] sniper@php.net
1) My reply was perfectly appropriate, you did not mention what configure line you had used nor that it worked in 5.2.0.
2) What exactly is said in phpinfo() output about what php.ini is loaded  when you have it in /etc ?
 [2007-05-25 23:15 UTC] sniper@php.net
Just tested latest 5.2 snapshot on a rhel4 machine and it worked just fine using exactly same ini config options as you pasted here.
Are you sure this isn't some SELinux issue? Do you get any errors in /var/log/messages ?? Can you reproduce this with CLI ?
 [2007-06-18 13:53 UTC] dbjh at gmx dot net
You were right about SELinux. When I set it to permissive there's no 
problem.
 [2007-06-20 16:28 UTC] sniper@php.net
Not any PHP bug then.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 22:01:35 2025 UTC