[cgiwrap-users] RE: #!/usr/bin/php
Brought to you by:
nneul
From: Neulinger, N. <nn...@um...> - 2002-08-09 15:20:58
|
Re PATH_TRANSLATED... I guess i'm just not sure what it's "supposed" to be. You're saying that the script is physically located at: /var/chroot/_nossh/k060881/htdocs/test.php and that path translated is set to this by cgiwrap: /var/chroot/_nossh/k060881/htdocs and is originally this by apache: /var/chroot/_nossh/k060881/htdocs/phpmagic.de/k060881/test.php I'm willing to change what cgiwrap does, so long as someone can provide me a pointer to a reference that says exactly what PATH_TRANSLATED is supposed to do, assuming that cgiwrap has the necessary information at the time. It does clearly look like it's bogus from cgiwrap. I see this definition on one site: Definition: A virtual-to-physical mapping of PATH_INFO, which can be used directly as an absolute path or file, available as an environment variable for CGI scripts.=20 I've also seen this on oreilly's site: Besides passing query information to a CGI script, you can also pass additional data, known as extra path information, as part of the URL. The extra path information depends on the server knowing where the name of the program ends, and understanding that anything following the program name is "extra." Here is how you would call a script with extra path information: http://some.machine/cgi-bin/display.pl/cgi/cgi_doc.txt Since the server knows that display.pl is the name of the program, the string "/cgi/cgi_doc.txt" is stored in the environment variable PATH_INFO. Meanwhile, the variable PATH_TRANSLATED is also set, which maps the information stored in PATH_INFO to the document root directory (e.g., /usr/local/etc/httpd/ public/cgi/cgi-doc.txt).=20 That one makes it look like it should be DOCUMENT_ROOT + PATH_INFO. I can do that if those vars are passed. (I believe they are). But is that what y'all think that cgiwrap should set it do? Alternatively, I can just leave it alone, and merely strip out the "/user/" part? -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nn...@um... University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 > -----Original Message----- > From: Daniel Nolte [mailto:dr...@gm...]=20 > Sent: Friday, August 09, 2002 10:06 AM > To: Neulinger, Nathan > Cc: cgi...@li... > Subject: RE: #!/usr/bin/php >=20 >=20 > Hi, >=20 > > Looks from the output below like the php options didn't get build or > > something... Make sure to do a make clean after you configure, and > make > > sure that PHP was detected properly when you ran configure. If it > didn't > > find php when you ran configure, it would have disabled the php > > handling. What's configure output look like? >=20 > *irghs* > My fault I did a: " --with-php-path=3D/usr/bin/php4 " instead of > " --with-php=3D/usr/bin/php4 ". Now it works nearly perfekt. >=20 >=20 > I just have to work a bit on PATH_TRANSLATED. >=20 > At the moment:=20 >=20 > PATH_TRANSLATED: > '/var/chroot/_nossh/k060881/htdocs/phpmagic.de/k060881/test.php' >=20 > Home Dir: '/var/chroot/_nossh/k060881' >=20 > Script Base Directory: '/var/chroot/_nossh/k060881/htdocs' >=20 > Script Absolute Path: '/var/chroot/_nossh/k060881/htdocs/test.php' >=20 >=20 > But the real Script Absolute Path is=20 > /var/chroot/_nossh/k060881/phpmagic.de/test.php >=20 > That is PATH_TRANSLATED where the last appereance of the username is > removed. Is it possible to change that ?:) >=20 >=20 > COMPLETE OUTPUT: *g* >=20 > <OUTPUT> > Initializing Logging > Redirecting STDERR to STDOUT >=20 > Setting SIGXCPU to default behaviour >=20 >=20 > Environment Variables: > QUERY_STRING: '' > SCRIPT_NAME: '/cgi-bin/cgiwrap/cgiwrapd' > SCRIPT_FILENAME: '/usr/lib/cgi-bin/cgiwrap/cgiwrapd' > PATH_INFO: '/k060881/test.php' > PATH_TRANSLATED: > '/var/chroot/_nossh/k060881/htdocs/phpmagic.de/k060881/test.php' > REMOTE_USER: '<NULL>' > REMOTE_HOST: '<NULL>' > REMOTE_ADDR: '80.142.156.229' >=20 >=20 > Trying to extract user from PATH_INFO. > Retrieved User Name: 'k060881' >=20 > User Data Retrieved: > UserID: 'k060881' > UID: '1004' > GID: '2000' > Home Dir: '/var/chroot/_nossh/k060881' >=20 > Script Base Directory: '/var/chroot/_nossh/k060881/htdocs' > Fetching script string >=20 > Trying to extract script from PATH_INFO > Extracted PATH_INFO 'test.php' > Building script path >=20 > Condensing slashes. >=20 > Script Relative Path: 'test.php' > Script Absolute Path: '/var/chroot/_nossh/k060881/htdocs/test.php' > Checking for special interpreted script (php). > Interpreter Path: '/usr/bin/php4' >=20 > Fixing Environment Variables. >=20 > Environment Variables: > QUERY_STRING: '' > SCRIPT_NAME: '/cgi-bin/cgiwrap/cgiwrapd/k060881/test.php' > SCRIPT_FILENAME: '/var/chroot/_nossh/k060881/htdocs/test.php' > PATH_INFO: '' > PATH_TRANSLATED: '/var/chroot/_nossh/k060881/htdocs' > REMOTE_USER: '<NULL>' > REMOTE_HOST: '<NULL>' > REMOTE_ADDR: '80.142.156.229' >=20 > Logging Request (File) >=20 > UIDs/GIDs Changed To: > RUID: '1004' > EUID: '1004' > RGID: '2000' > EGID: '2000' >=20 > Changing current directory to '/var/chroot/_nossh/k060881/htdocs' >=20 >=20 >=20 > Output of script follows: > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > X-Powered-By: PHP/4.1.2 > Content-type: text/html >=20 > just a test >=20 > </OUTPUT> >=20 > Bye > Daniel >=20 >=20 >=20 >=20 >=20 |