From: Colm D. <col...@gm...> - 2006-01-12 03:56:17
|
Hi, I was trying to run a php script I obtained as a CGI using a php4 binary with miniserv.pl but kept running into the "No input file specified" error message. After a bit of Googling I found that a common problem withr running php CGIs in this way is that the SCRIPT_FILENAME enviroment variable may not have been defined - however I see that this is defined in miniserv.pl after some discussion of this I found in the archives [1]. Anyway - that wasn't my problem, just a bit of backgroud. I traced the C code of the php4 binary when running my php CGI until I found that it was failing when doing a fstat() on a filename it had opened which turned out to be a directory and not a file as expected.=20 It turns out it is basing this on the PATH_TRANSLATED environment variable which miniserv.pl had defined as the same as my document root. I had a look at the CGI spec [2] which stated the following for PATH_TRANSLATED : PATH_TRANSLATED is derived by taking any path-info component of the request URI (see section 6.1.6), decoding it (see section 3.1), parsing it as a URI in its own right, and performing any virtual-to-physical translation appropriate to map it onto the server's document repository structure. If the request URI includes no path-info component, the PATH_TRANSLATED metavariable SHOULD NOT be defined. I found the last bit interesting so I tried editing miniserv.pl to not define PATH_TRANSLATED and suddenly everything started working. So - is it possible that PATH_TRANSLATED is not being defined correctly here, or iare there cases where it should not be defined as seems to be being suggested here? Thanks, Colm [1] http://lists.swelltech.com/pipermail/webmin-devel-archive/2002-October/= 000750.html [2] http://cgi-spec.golux.com/draft-coar-cgi-v11-03.txt |