Re: [cgiwrap-users] SCRIPT_NAME env variable
Brought to you by:
nneul
From: Gary W. <gw...@pl...> - 2005-05-20 18:17:21
|
On Fri, 2005-05-20 at 17:33 +0100, Gary Wilson wrote: > Hi! > > I am having some issues in beta testing with my new CGI solution - it is > using Apache and mod rewrite to make all PHP files get parsed as a CGI > binary, through CGI_WRAP. Test users however are complaining that > several environment variables are getting mangled through the solution, > which is preventing certain script packages install scripts from working > correctly. The first report was SCRIPT_NAME being prepended with the > username e.g. /testuser1/phpinfo.php when it _should_ read just > phpinfo.php > > After a bit of testing, it seems it is CGI_WRAP adding this info in > (presumably to allow things to work in a flat virtualhost environment > or similar?) But it seems to be tripping my users up on my solution. > > Can someone confirm that the code in util.c which starts with the > comment "Set the correct SCRIPT_NAME environment variable" is in fact > doing the mangling I refer to, and if so, is this behaviour > configurable, or shall I just tweak the c code to do what I need? > Ah ha - I found the --with-use-script-url compile option which fixed everything that's actually broken. However, I am having an aesthetic issue (cannot believe how petty this user is_ with the _SERVER["SCRIPT_FILENAME"] and _ENV["SCRIPT_FILENAME"] variables, which BOTH have 2 extra slashes between the directory path and the filename: They show (e.g.): /files/home1/inttestpn1///phpinfo.php They should show: /files/home1/inttestpn1/phpinfo.php But I am failling to see where they are being introduced. On a similar vein, the PATH_TRANSLATED variable has the username in twice: /files/home1/inttestpn1/inttestpn1/phpinfo.php for no obvious reason. None of these errors are giving me any functionality headaches, purely aesthetic (i.e. the users see the contents are wrong and complain, ignoring the fact the the contents aren't used or have slashes in that don't make a difference) Can anyone advise where these extra slashes and an extra username might be coming from? Thanks Gary |