[nycphp-talk] Bizarre PHP putenv/getenv results

Bob Klos bklos at
Fri Aug 10 16:11:22 EDT 2007

I don't think that's the case because 9 times out of 10 the page loads. 
If you hit refresh a few times you'll catch the error, then refresh and
it'll work again. 

-----Original Message-----
From: talk-bounces at [mailto:talk-bounces at] On
Behalf Of csnyder
Sent: Friday, August 10, 2007 2:41 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Bizarre PHP putenv/getenv results

On 8/9/07, Bob Klos <bklos at> wrote:
> Occasionally, the  environment variables are corrupted, usually ending 
> up with a blank page since  the app has no or corrupt information to 
> work from.
> a simple example  would be:
> putenv("QUERY_STRING=$url");

I have near-zero experience with putenv(), but my first impression on
looking at the code is that it looks like it will break if shell
metacharacters or anything other than low ascii is in the php vars.

Could there be stray newlines or some other characters in the values that
would cause breakage?

Chris Snyder
New York PHP Community Talk Mailing List

NYPHPCon 2006 Presentations Online

Show Your Participation in New York PHP

More information about the talk mailing list