http://bugs.winehq.org/show_bug.cgi?id=8924
--- Comment #19 from jvlad dmda@yandex.ru 2008-09-23 09:13:22 --- no, I did not say that the problem is caused by the big number of the environment variables and honestly there is absolutely no theory in my bugreport. I checked php code with debugger and found the origin of the problem then filed the bug.
Once again, the problem is caused by getenv(). Value returned by this function may change after some memory/or/evironment related functions like putenv/malloc are called. In other words, value returned by getevn() is not persistent.
Although, with smaller number of environment variables, the values returned by getenv() are persistent (not changed upon putenv/malloc calls) and php-cgi will start to work. Feel free to comment out all HTTP_* variables and you'll see it.