php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54197 [PATH=] sections incompatibility with user_ini.filename set to null
Submitted: 2011-03-08 19:25 UTC Modified: 2012-04-20 02:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: julientld at free dot fr Assigned: ab (profile)
Status: Closed Package: PHP options/info functions
PHP Version: 5.3.5 OS: Windows Server 2003 SP2
Private report: No CVE-ID: None
 [2011-03-08 19:25 UTC] julientld at free dot fr
Description:
------------
Hello,

My configuration :

Windows Server 2003 SP2
IIS 6.0
PHP 5.3.5 VC9 x86 NTS
FastCGI 1.5
WinCache 1.1

Same problem seen with IIS 5.1 under Windows XP SP3.

Test script:
---------------
In the php.ini file (production based) :


[PHP]

;I do not want users to set their own configuration file so I disable the below option (set to null)
user_ini.filename =

;I want to set my own simple PATH sections like that
[PATH=D:/www/]
upload_max_filesize = 5M

Expected result:
----------------
I expect to get no error

Actual result:
--------------
But all the php script I open return the following :


FastCGI Error
The FastCGI Handler was unable to process the request. 
--------------------------------------------------------------------------------

Error Details:

•The FastCGI process exited unexpectedly
•Error Number: -1073741819 (0xc0000005).
•Error Description: Unknown Error
HTTP Error 500 - Server Error.
Internet Information Services (IIS)

I obtain no error if I remove the [PATH=] section or set a filename to user_ini.filename

Patches

fix_unintialized_doc_root (last revision 2012-03-01 10:23 UTC by ab@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-08 19:31 UTC] pajoye@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: pajoye
 [2011-03-08 19:31 UTC] pajoye@php.net
What says the error log? Or is it actually a crash?
 [2011-03-08 19:43 UTC] julientld at free dot fr
IIS does not crash. It continues to serve static files. But all php scripts return the HTTP 500 error.

There is nothing in the php log file.
 [2011-03-09 10:50 UTC] carsten_sttgt at gmx dot de
Some more infos. Assuming this as last lines in "php.ini":
| [PATH=C:/Users/Public/Documents/htdocs/]
| user_ini.filename =

now in the shell (php is in $PATH):
cd C:\Users\Public\Documents\htdocs\
php-cgi -f phpinfo.php
--> that's working

php-cgi -f C:\Users\Public\Documents\htdocs\phpinfo.php
--> CGI / FastCGI has stopped working

(1a30.7d0): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=00d02df8 ecx=00000005 edx=00d02da0 esi=00d02df0 edi=519e0c1c
eip=1001f307 esp=00c0dccc ebp=00d04410 iopl=0         nv up ei ng nz ac pe cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010297
php5ts!zend_do_fetch_lexical_variable+0x27:
1001f307 8b0c37          mov     ecx,dword ptr [edi+esi] ds:0023:526e3a0c=????????


BTW:
In 5.3.6RC2 the behavior is different:
PHP is not crashing, but user_ini.filename is not set to none (it's still 	".user.ini").
 [2011-03-09 11:54 UTC] julientld at free dot fr
Your problem seems to be a little different from mine, no?

Me, I can't set user_ini.filename to null if I want to use PATH sections. I do not want to define a user_ini.filename value in a PATH section. But there are perhaps multiple bugs concerning these features that said.
 [2011-03-09 12:01 UTC] pajoye@php.net
-Status: Feedback +Status: Assigned
 [2011-03-09 12:01 UTC] pajoye@php.net
Please report only using the 5.3.6RC2 if crashes do not appear with this version. 

@carsten_sttgt at gmx dot de
user_ini.filename is not meant to be changed but having one value per PHP 
instance. It should not crash but that's a different issue as the one described 
here. Please open a new bug using the latest release (5.3.6RC2 if possible).
 [2011-03-09 12:19 UTC] carsten_sttgt at gmx dot de
> user_ini.filename is not meant to be changed but having one value per
> PHP instance. It should not crash but that's a different issue as the
> one described here.

Why is this a differnt issue?
>  [2011-03-08 18:25 UTC] julientld at free dot fr
> 
> ;I do not want users to set their own configuration file
> so I disable the below option (set to null)
> user_ini.filename =
>
> [PATH=D:/www/]
>
> I obtain no error if I remove the [PATH=] section or set a filename to
> user_ini.filename

And that's what I'm doing:
- Having a PATH section (which value must the same as the script which is executed)
- defining user_ini.filename to nothing

--> result crash

Maybe  you mean a different order?
 [2011-03-09 12:22 UTC] pajoye@php.net
For the reason I just mentioned in the same paragraph.

Please open another bug for this problem, thanks.
 [2011-03-09 12:27 UTC] carsten_sttgt at gmx dot de
> For the reason I just mentioned in the same paragraph.

Sorry, which reason? So you mean the different order (at least the function trace is also the same)? IMHO I'm doing the same as the OP.

BTW: also happens with 5.3.6RC2.
 [2011-03-09 12:40 UTC] pajoye@php.net
@carsten_sttgt at gmx dot de

It is not supposed to be done in a section. But at the global level. However it 
should not crash so please verify that it actually crashes with 5.3.6RC2 (or 
not).

The problem here is about the ability to disable the functionality by not 
setting the filename option, as described in the manual.

Now, for any further comments about your specific issue, please open a new 
report. Thanks for your understanding. (ich kann es auch auf Deutsch schreiben, 
wenn es hilft ;)
 [2011-03-09 13:04 UTC] carsten_sttgt at gmx dot de
Well, if this makes you happy:
php -v
PHP 5.3.6RC2 (cli) (built: Mar  3 2011 01:08:35)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

Adding this to "php.ini":
| user_ini.filename =
| [PATH=C:/Users/Public/Documents/htdocs/]
| upload_max_filesize = 5M

php-cgi -f "C:\Users\Public\Documents\htdocs\test.php"
--> Result crash.

(eec.14a4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=01d92cc8 ecx=00000005 edx=01d92c70 esi=01d92cc0 edi=4f3893f4
eip=5c7fc1d7 esp=009bd9bc ebp=01d942e0 iopl=0         nv up ei ng nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210283
php5ts!_zend_mm_free_int+0x57:
5c7fc1d7 8b0c37          mov     ecx,dword ptr [edi+esi] ds:0023:5111c0b4=????????
 [2011-03-09 13:09 UTC] pajoye@php.net
I explicitly asked three times to open a new issue for this exact problem, which 
is different (as in require different fix). Why do you insist to post this info 
here? That's getting annoying.
 [2011-03-09 13:20 UTC] carsten_sttgt at gmx dot de
> which is different

No. My last example is exactly the first "Test Script" from  julientld at free dot fr. Just without comments.
 [2011-03-09 13:22 UTC] pajoye@php.net
-Block user comment: N +Block user comment: Y
 [2011-03-09 13:22 UTC] pajoye@php.net
So let do it the hard way until I work on the initial problem.
 [2012-01-16 21:45 UTC] info at garrant dot com
I have the exact issue with PHP 5.3.9 running on Windows 2008 IIS7.  When you try to uncomment user_ini.filename = and use a PATH section, there is a FastCGI error and all PHP pages will fail.  I even tried adding open quotes and it still fails with user_ini.filename = "".  I want to disable so sites cannot user individual .ini files.  How can we do this?
 [2012-03-01 10:09 UTC] ab@php.net
-Status: Assigned +Status: Analyzed -Assigned To: pajoye +Assigned To: ab
 [2012-03-01 10:23 UTC] ab@php.net
The following patch has been added/updated:

Patch Name: fix_unintialized_doc_root
Revision:   1330597390
URL:        https://bugs.php.net/patch-display.php?bug=54197&patch=fix_unintialized_doc_root&revision=1330597390
 [2012-03-01 10:35 UTC] ab@php.net
The bug was still in the 5.3 trunk, but it's section independent as there was an 
attepmpt to free an uninitialized variable. The bug is windows only. With the 
patch, putting

user_ini.filename =

outside the path section, both local and global values are null. Putting it into 
the section only local value is null.
 [2012-03-01 11:16 UTC] julientld at free dot fr
Hi,

Thanks for the patch. I will try it as soon as it is avaible in a beta version of PHP 5.3.x.

Julien
 [2012-03-01 22:20 UTC] mattficken@php.net
I can reproduce this problem on Windows 2003 (and also Windows 2008r2).

The attached patch, when php recompiled, fixes the problem for me. It fixes it both on 5.3.5 and 5.3.10 on Windows 2003 and Windows 2008r2.
 [2012-04-20 02:15 UTC] felipe@php.net
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c3b0fb4fbe20e46266a792cb1f332d08ef40923b
Log: - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab@php.net
 [2012-04-20 02:15 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch and for testing!
 [2012-04-20 02:15 UTC] felipe@php.net
-Status: Analyzed +Status: Closed
 [2012-04-20 06:40 UTC] julientld at free dot fr
Thanks for this fix!

PS: Windows Snaps links are dead at this time (404 error)
 [2014-10-07 23:26 UTC] stas@php.net
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=c3b0fb4fbe20e46266a792cb1f332d08ef40923b
Log: - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab@php.net
 [2014-10-07 23:37 UTC] stas@php.net
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=c3b0fb4fbe20e46266a792cb1f332d08ef40923b
Log: - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab@php.net
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC