[Bug 8924] Problem passing environment variables into php.exe

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Sep 23 09:53:15 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=8924





--- Comment #21 from jvlad <dmda at yandex.ru>  2008-09-23 09:53:14 ---
from the CGI perspectives, there are some crusial variables to have a CGI
process started correctly, while the other variables are informative only. Feel
free to comment out all variables with HTTP_ and SERVER_ in their names. 
I commented out HTTP_ and got php-cgi.exe to work under wine. 
Still, it does not really matter which particular variable you comment out. You
can for example comment out HTTP_AGENT and re-introduce the same value under
HTTP_GENTA name and get the same effect.

Php-cgi.exe relies on persistence of the values retuened by getenv.
It first fetches some values, then changes the others and expect the first ones
to remain the same and it works this way under Windows while under Wine the
values are changed.

Check init_request_info() in sapi\cgi\cgi_main.c (see php source tree)
In short, it first reads SCRIPT_FILENAME and PATH_TRANSLATED and keeps the
pointers to the values returned by getenv(), then adds new variables, such as
ORIG_PATH_INFO, then runs the script file. To do this it takes the file name
from SCRIPT_FILENAME saved at the 1st step.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list