Skip to main content.
home | support | download

Back to List Archive

Re: Got it working on Windows IIS

From: Marko Faldix <marko.faldix(at)not-real.mplusr.de>
Date: Tue Jan 20 2004 - 15:02:02 GMT
Hi,

> > > See:
> > > http://hoohoo.ncsa.uiuc.edu/cgi/env.html
> >
> >
> > Read it, thanks for this link. What is wrong with PATH_TRANSLATED?
>
> It's the PATH_INFO translated -- and PATH_INFO is the path *after* the
> script name.  So it may not even exist.  And if it doesn't exist then
> PATH_TRANSLATED doesn't exist.  At least that's one thing in the
> so-called "standard":
>
> #  PATH_INFO
>
> The extra path information, as given by the client. In other words,
> scripts can be accessed by their virtual pathname, followed by extra
> information at the end of this path. The extra information is sent as
> PATH_INFO. This information should be decoded by the server if it comes
> from a URL before it is passed to the CGI script.
>
> # PATH_TRANSLATED
>
> The server provides a translated version of PATH_INFO, which takes the
> path and does any virtual-to-physical mapping to it.
>
>
>
> > > Can you report back what IIS returns?
> >
> > Yes, here reduced to what we need. I put it into
> > C:\home\mydir\swish\test.cgi and called http://localhost/swish/test.cgi
> > which returns
> >
> > GATEWAY_INTERFACE : CGI/1.1
> > HTTP_HOST : localhost
> > OS : Windows_NT
> > PATH :
C:\Perl\bin\;C:\Programme\Swish-E;C:\Programme\SWISH-E\lib\swish-e;
> > ..
> > PATH_INFO : /swish/test.cgi
> > PATH_TRANSLATED : C:\home\mydir\swish\test.cgi
> > REQUEST_METHOD : GET
> > SCRIPT_NAME : /swish/test.cgi
> > SERVER_NAME : localhost
> > SERVER_SOFTWARE : Microsoft-IIS/5.0
> >
> >
> > IIS does not have variable SCRIPT_FILENAME!
>
> Right -- not part of the "standard".
>
> Just guessing, but Apache was smart enough to realize that the standard
> didn't provide a way to get to the script's path so added
> SCRIPT_FILENAME.
>
> Microsoft, being Microsoft, decided to just change the standard by
> changing the meaning of PATH_INFO and PATH_TRANSLATED.  Does MS do this
> crap on purpose, you suppose?
>
>
> > If I had the path to the directory where the called swish.cgi is, I
could
> > take this directory as my default to look for configuration
> > file, appreciating same code for both Apache and IIS. So PATH_TRANSLATED
or
> > SCRIPT_NAME seems to be useful.
> >
> > Would you suggest to prefer SCRIPT_NAME?
>
> SCRIPT_NAME is not useful.  It's the URL path, which may or may not have
> any relation to the real path of the file.
>
> What about other environment vars on IIS?  APPL_PHYSICAL_PATH?


No, all what I could use is:

ALLUSERSPROFILE : C:\Dokumente und Einstellungen\All Users
COMMONPROGRAMFILES : C:\Programme\Gemeinsame Dateien
COMSPEC : C:\WINNT\system32\cmd.exe
CONTENT_LENGTH : 0
GATEWAY_INTERFACE : CGI/1.1
HTTPS : off
HTTP_ACCEPT : text/html, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
HTTP_ACCEPT_CHARSET : windows-1252, utf-8, utf-16, iso-8859-1;q=0.6, *;q=0.1
HTTP_ACCEPT_ENCODING : deflate, gzip, x-gzip, identity, *;q=0
HTTP_ACCEPT_LANGUAGE : de
HTTP_CONNECTION : Keep-Alive, TE
HTTP_HOST : localhost
HTTP_REFERER : http://localhost/swish/
HTTP_TE : deflate, gzip, chunked, identity, trailers
HTTP_USER_AGENT : Opera/7.03 (Windows NT 4.0; U)  [de]
INSTANCE_ID : 28
NUMBER_OF_PROCESSORS : 1
OS : Windows_NT
OS2LIBPATH : C:\WINNT\system32\os2\dll;
PATH : C:\Perl\bin\;C:\Programme\Swish-E;C:\Programme\SWISH-E\lib\swish-e;
..
PATH_INFO : /swish/test.cgi
PATH_TRANSLATED : C:\home\mydir\swish\test.cgi
PROCESSOR_ARCHITECTURE : x86
PROCESSOR_IDENTIFIER : x86 Family 6 Model 3 Stepping 1, AuthenticAMD
PROCESSOR_LEVEL : 6
PROCESSOR_REVISION : 0301
PROGRAMFILES : C:\Programme
REQUEST_METHOD : GET
SCRIPT_NAME : /swish/test.cgi
SERVER_NAME : localhost
SERVER_PORT : 80
SERVER_PORT_SECURE : 0
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Microsoft-IIS/5.0
SYSTEMDRIVE : C:
SYSTEMROOT : C:\WINNT
TEMP : C:\WINNT\TEMP
TMP : C:\WINNT\TEMP
WINDIR : C:\WINNT


I will leave my pathes  to two versions, one for IIS and one for apache.


Marko Faldix
Received on Tue Jan 20 15:02:42 2004