ID:               48695
 Comment by:       sriram dot natarajan at gmail dot com
 Reported By:      allerlei+bugs dot php dot net at sihw dot nl
 Status:           Open
 Bug Type:         CGI related
 Operating System: Centos 4/5
 PHP Version:      5.2.10
 New Comment:

what configuration do i need to set in apache to reproduce this ?


Previous Comments:
------------------------------------------------------------------------

[2009-07-02 07:42:01] allerlei+bugs dot php dot net at sihw dot nl

Yes. This is what happened in 5.2.10. PHP_SELF and SCRIPT_FILENAME
changed in respect to 5.2.8. (Sorry, I skipped 5.2.9). I installed
5.2.10 but had to rebuild 5.2.8 because of the PHP_SELF troubles.

This happens when some process (in my case an external handler
executable that starts php under the UID of the virtual web site, but if
would take a look at suexec as well) juggles with SCRIPT_NAME,
ORIG_SCRIPTNAME etcetera.

By the way: I am not saying one way is better than the other. PHP_SELF
should reflect the url the client needs to call the same script again
(right?). So maybe the way those cgi wrappers change the cgi environment
should be changed. The "startscript" executable I use company wide uses
the same logic for building ORIG_SCRIPTNAME etcetera as the old cgiwrap
code it is slightly based on.

But: this looks to me as a big change for a minor version number
update. I would expect the same external behaviour between versions
numbers that differ only behind the second dot.

Maybe we should get it straight which environment variables php-cgi
uses to create PHP_SELF and friends.

If you need any more information, please tell me. (I am going to be on
a holiday soon, but will be back...).


Thanks,

Jelmer Jellema

------------------------------------------------------------------------

[2009-07-02 04:29:19] sriram dot natarajan at gmail dot com

have you tried this issue with recent php 5.2.10 . r u able to
reproduce 
this with 5.2.10 as well ?

------------------------------------------------------------------------

[2009-06-25 14:22:35] allerlei+bugs dot php dot net at sihw dot nl

Description:
------------
Bug #47625 was closed as bogus (because it would be the same as bug
#47042) but it is not. In version 5.2.10 at least, PHP_SELF and
SCRIPT_FILENAME are set based on the ORIG_SCRIPTNAME, while in version
5.2.8 these are based on SCRIPT_NAME.

So bug #47042 fixes some bug, but introduces a new one. Therefore this
is not a duplicate bug. It is not bogus because the values of PHP_SELF
etc changed betwoon 5.2.10 without this being part of the specification
for 5.2.10. It breaks a lot of code on my systems, including phpmyadmin
and joomla.

Problem is that PHP_SELF should refer to the URL before the internal
redirect or external handler. This is a problematic requirement because
of all the jugling with SCRIPTNAME and ORIG_SCRIPTNAME, but bug #47625
described the bug exactly. The problem might me in the naming: handlers
put the redirection into ORIG_SCRIPTNAME and the original path in
SCRIPTNAME.

I use a handler called startscript that is called with some pathinfo
like /../startscript/php/myuser/path/to/script/. 
So the path
/centraal/scripts/info.php
when called from a vsite owned by user jelmer, is rewritten to
/usr/bin/startscript/php/jelmer/scripts/info.php

but PHP_SELF should remain /centraal/scripts/info.php

Thank you for your thougths,

Jelmer



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48695&edit=1

Reply via email to