php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20887 /php.ini
Submitted: 2002-12-08 14:53 UTC Modified: 2003-04-25 11:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: oden dot eriksson at linux-mandrake dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.3.0-dev OS: Mandrqke Linux 9.0
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: oden dot eriksson at linux-mandrake dot com
New email:
PHP Version: OS:

 

 [2002-12-08 14:53 UTC] oden dot eriksson at linux-mandrake dot com
If /php.ini exists, that one is used no matter what PHPRC env is set or compiled in when starting up apache from a SysV script. Is it a bug in php, or could it be the Mandrake Linux 9.0 system?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-08 16:22 UTC] michael dot mauch at gmx dot de
I can't see that /php.ini is used here, but php/php-cli.ini is used, i.e. a file relative to the place from where PHP was started. 
With PHPRC=/xizzy I get:

# strace -eopen php -r 'echo "bla";' 2>&1|grep ini
open("php/php-cli.ini", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/xizzy/php-cli.ini", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/php-cli.ini", O_RDONLY|O_LARGEFILE) = 3
open("/usr/local/lib/php/browscap/browscap.ini", O_RDONLY|O_LARGEFILE) = 3

And if php/php-cli.ini is there, PHP only reads that one. This is with 4.3.0-cvs from today, and I don't have Mandrake here (once upon a time, it was a SuSE Linux).
 [2002-12-08 22:14 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


 [2002-12-09 23:39 UTC] oden dot eriksson at linux-mandrake dot com
I have now tried this using apache_1.3.27 + php-4.2.3 (from Mandrake Cooker) and are experiencing the same thing. I have no idea how to debug this further, all I can say is if /php.ini exists, values from that one shows up from phpinfo() called from a php file. I just stumbled upon this by accident.
 [2002-12-11 01:48 UTC] sniper@php.net
I just got bitten by this myself too. But it doesn't happen
with CLI for me, only with the Apache module.

 [2002-12-11 23:46 UTC] pollita@php.net
While I could not duplicate the error on my system, I did notice something interresting in my strace:

-- Launching php with:
-- #!sapi/cli/php
-- from php4 root
open("sapi/cli//php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("sapi/cli//php.ini", O_RDONLY)     = -1 ENOENT (No such file or directory)

Note the pair of forward slashes between the path to php and the php.ini filenames?


So I tried something different:
-- Launching php with:
-- #!php
-- from sapi/cli in php4 root
open("php/php-cli.ini", O_RDONLY)       = -1 ENOTDIR (Not a directory)
open("/usr/local/lib/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("php/php.ini", O_RDONLY)           = -1 ENOTDIR (Not a directory)


Note this time, it treats the php executable as a path!
 [2002-12-12 08:55 UTC] edink@php.net
Suspending this bug since the descision made on this thread:

http://www.zend.com/lists/php-dev/200202/msg01325.html

was to keep CWD in php.ini search path, except for the CLI sapi. Since apache does cd / on startup, php.ini in / will be read. Unless a new decission is made on php-dev, this behaviour is not going to change.
 [2003-04-25 11:19 UTC] sniper@php.net
Wont fix.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 21:01:35 2025 UTC