NYCPHP Meetup

NYPHP.org

[nycphp-talk] $_SERVER

Nate Abele nate at cakephp.org
Tue May 29 11:01:47 EDT 2007


> Date: Sun, 27 May 2007 23:30:26 -0400
> From: Jon Baer <jonbaer at jonbaer.com>
> Subject: Re: [nycphp-talk] $_SERVER
> To: NYPHP Talk <talk at lists.nyphp.org>
>
> Well I remembered it from a PHP internals talk I saw once and the
> same question was asked about how $_* variables are pushed up from
> the server layer.  Although Nate's solution is definitely what you
> want.  It makes sense though as you work up the stack to have common
> variables to depend on even if they need to be set in the environment.
>
> - Jon
>
> On May 27, 2007, at 1:30 PM, David Krings wrote:
>
>> Jon Baer wrote:
>>>  From what I recall this depends on what's thrown into it @ the
>>> SAPI handler level which you can view via source ...
>>> http://lxr.php.net/source/php-src/sapi/
>>> http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c
>>> http://lxr.php.net/source/php-src/sapi/isapi/php5isapi.c
>>
>> Thanks, but are you sure about that being a PHP dependent thing? As
>> mentioned earlier I walked into the trap with EnginSrv, which is
>> fairly similar to IIS. I used the exact same PHP binaries on
>> EnginSrv as well as Apache and $_SERVER was different.
>> And in NuSphere I replaced their stripped down stock PHP version
>> with the one from Luckasoft (which comes straight from php.net) and
>> $_SERVER is different in each instance using the internal server
>> and different again when using Apache.
>> It seems to be server app dependent and PHP just packages up
>> anything it can get into a nice array. Or is that what you wanted
>> to point out? I'm not that versed in reading C code. :(
>>
>> David

Jon,

Thanks for posting those links, btw.  They'll be of help in emulating  
other environment variables.

- Nate



More information about the talk mailing list