[nycphp-talk] Bizarre PHP putenv/getenv results

csnyder chsnyder at
Fri Aug 10 14:41:20 EDT 2007

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

More information about the talk mailing list