php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35502 PHP 5.1.1 CGI does not attempt to read php.ini from current directory
Submitted: 2005-12-01 12:47 UTC Modified: 2006-01-03 14:12 UTC
From: andrew dot tulloch at maximalls dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.1.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andrew dot tulloch at maximalls dot com
New email:
PHP Version: OS:

 

 [2005-12-01 12:47 UTC] andrew dot tulloch at maximalls dot com
Description:
------------
PHP 5.0.5 CGI SAPI attempts to read php.ini from the current directory, PHP 5.1.1 CGI SAPI, compiled with same options does not.

Reproduce code:
---------------
strace php 2>&1 | grep php.ini

Expected result:
----------------
Expected and actual running PHP 5.0.5:
strace /opt/php-5.0.5/bin/php 2>&1 | grep php.ini
open("./php.ini", O_RDONLY)             = -1 ENOENT (No such file or directory)
open("/opt/php-5.0.5/bin//php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/php-5.0.5/lib/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)

Note attempt to read php.ini from current directory.

Actual result:
--------------
Running PHP 5.1.1:
strace /opt/php-5.1.1/bin/php 2>&1 | grep php.ini
open("/opt/php-5.1.1/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/php-5.1.1/lib/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)

No attempt to read php.ini from current directory.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-01 13:10 UTC] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 [2005-12-01 13:27 UTC] andrew dot tulloch at maximalls dot com
Could I get a reason for this is not being a bug?

It certainly seems to be a regression from 5.0.5 unless this feature was previously unintended and now considered corrected.
 [2006-01-03 13:31 UTC] andrew dot tulloch at maximalls dot com
Sorry, Could I get an explanation for this not being classed as a bug.

Unless I'm missing something the behaviour has changed from PHP 5.0.5 to 5.1.1.

As some background we runs sites using apache with suexec, with each site having a cgi-bin with a php executable (shell script wrapper) and a php.ini. When PHP is run as CGI is attempts to read php.ini in the cgi-bin directory, then the default php.ini location. This allowed per site php.ini settings, which no longer works with 5.1.1 because it doesn't attempt to read php.ini from the current directory.
 [2006-01-03 14:12 UTC] sniper@php.net
It's not bug because it was never documented to behave like that. 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 18:01:34 2025 UTC