[imp] Using IMP with PHP running as a CGI

Sameh Ghane sw@anthologeek.net
Thu, 3 Oct 2002 17:38:12 +0200


Le (On) Wed, Oct 02, 2002 at 07:26:22PM +0200, Sameh Ghane ecrivit (wrote):
> Hi,
> 
> And beside this, what are the technical reasons why we should not use IMP with
> PHP as a CGI ?

Got it. The problem is that $_SERVER['SCRIPT_NAME'] refers to the php CGI
wrapper (the executable), and not the php script.

This problem should arise for every one using PHP as a CGI, with suexec or any
wrapper.

The problem can be solved by switching from SCRIPT_NAME to PHP_SELF.


Now, is it a good idea (at least for people using PHP as a CGI) to replace every
SCRIPT_NAME occurence in Horde+IMP sources ? $_SERVER['SCRIPT_NAME'] is heavily
used in the code, it's strange it didn't bite me before.

And why do horde project/IMP people use $_SERVER['SCRIPT_NAME'] instead of
$_SERVER['PHP_SELF'] ?

Maybe it could be an add-on to the FAQ or something.

Thank you,

-- 
Sameh