php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #37782 php.ini in CWD not parsed
Submitted: 2006-06-12 01:59 UTC Modified: 2006-06-18 11:51 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lordi at msdi dot ca Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.1.4 OS: Windows 2003
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: lordi at msdi dot ca
New email:
PHP Version: OS:

 

 [2006-06-12 01:59 UTC] lordi at msdi dot ca
Description:
------------
Based on this page:
http://ca.php.net/manual/en/configuration.php#ini.register-globals

a php.ini file located in the current directory should be parsed before a file located in c:\windows\php.ini

If I use the php-cli.exe to parse files from iis, the c:\windows\php.ini is parsed even if there is a php.ini file in the local directory of the called script...

I tested the directory with getcwd() and it showed the right path...

I ran sysinternals filemon and I confirmed the bug or at least the documentation problem...

Tracing the disk access, I saw php-cli.exe tried to access c:\php.ini but got a not found error
Then the process tried to access c:\windows\php.ini which succeeded, but without trying to load the php.ini file from the documentation as per the documentation...

This worked fine in php 5.03, I just upgraded/clean reinstalled today

It might be a big security risk for people relying on local php.ini files since it's another php.ini file that gets parsed


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-16 16:36 UTC] colder@php.net
I can't reproduce it (php5.1.4 @ windowsXP)

Anyway, where did you find a php-cli.exe file ?
The CLI executable is only called php.exe in PHP5.
 [2006-06-16 16:49 UTC] nlopess@php.net
php-cli.exe is available in PHP 4 only. I've tested with php 5.2 and everything is working correctly.
 [2006-06-18 10:33 UTC] lordi at msdi dot ca
Sorry, it's a typo in my previous message...

I was talking about php-cgi.exe not php-cli.exe
 [2006-06-18 11:51 UTC] nlopess@php.net
Ah, the CGI SAPI doesn't read the current dir, yes (security purpose). But it is described in the page you mention.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC