Re: PHP 4.0 Bug #6581 Updated: Buggy isapi PATH_INFO() under Zeus

From: Date: Thu, 14 Sep 2000 11:22:00 +0000
Subject: Re: PHP 4.0 Bug #6581 Updated: Buggy isapi PATH_INFO() under Zeus
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-33235@lists.php.net to get a copy of this message
Yes... it is setup to run "out of process". I can run code, etc with no problem... just the pathinfo and pathtranslated are hosed. I really think this is a problem with Zeus and not with PHP. Earlier versions of Zeus had the exact same problem with regular CGIs. They have fixed the CGI problem. I snooped the isapi communications between Zeus and PHP and zeus was passing the script name rather than the stuff after the script name as both script_name and path_info. I have reported the issue to Zeus, but have yet to hear a response other than an ack. On the bright side, the request_uri is correct, and the path_info is now the script name, and the querystring is correct, so I can just subtract the script name and querystring from the request_uri to get the correct path_info. Kind of kludgy, but it works. From the zeus config: modules!isapi!enabled yes modules!isapi!runeextensions yes modules!mime!types!api application/x-httpd-isapi modules!map!alias_types!isapi application/x-httpd-isapi modules!map!alias!/isapi!filepath %zeushome%/web/bin modules!map!alias!/isapi!type isapi modules!map!handlers!php /isapi/libphp4.so Here is what I sent to Zeus: I am trying to get some ISAPI stuff to work with the Zeus web server and I think I found bug. From the Zeus isapi documentation (/apps/web/docs/modules/isapi/index.html): PATH_INFO: Additional path information after the script name. ^^^^^^^^^^^^^^^^^^^^^ If I make a call which is handled by ISAPI, such as: http://demo.idea-net.com/test/phack.php/1/2/3?xyz=2 I get the following (which is incorrect) from the isapisnoop: PATH_INFO: /test/phack.php QUERY_STRING: xyz=2 REQUEST_URI: /test/phack.php/1/2/3?xyz=2 This should read: PATH_INFO: /1/2/3 QUERY_STRING: xyz=2 REQUEST_URI: /test/phack.php/1/2/3?xyz=2 I think the PATH_TRANSLATED is incorrect as well, but I didn't verify that one. % uname -a SunOS xxxx 5.6 Generic_105181-xx sun4u sparc SUNW,UltraSPARC-IIi-Engine % /bin/su # ./start-zeus Initializing Zeus Application Framework. (C) Zeus Technology Ltd 2000 Zeus Admin Server - (C) Zeus Technology Ltd 2000 Version 3.3.7, Build date: Aug 8 2000 22:47:23 INFO:Zeus Admin Server started INFO:Version 3.3.7, Build date: Aug 8 2000 22:47:23 INFO:http://xxxx.idea-net.com:xxxx INFO:Zeus Admin Server running Zeus Web Server - (C) Zeus Technology Ltd 2000 Version 3.3.7, Build date: Aug 8 2000 22:47:23 Process permissions set to xxxx:xxxx INFO:Zeus Web Server started INFO:Version 3.3.7, Build date: Aug 8 2000 22:47:23 INFO:Zeus Web Server running Here is the full isapisnoop: ---------------------------------------- | v <demo> Run Extension Request: %zeushome%/web/bin/libphp4.so data size: 0 agelimit: 0 iheaders: Accept-Language: en Cookie: JSESSIONID=To1011mC5915471211401706At Host: demo.idea-net.com Accept-Encoding: gzip User-Agent: Mozilla/4.6 [en] (X11; I; SunOS 5.7 i86pc) Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* Accept-Charset: iso-8859-1,*,utf-8 Connection: Keep-Alive srvvars: HTTP_CONNECTION: Keep-Alive HTTP_ACCEPT_CHARSET: iso-8859-1,*,utf-8 HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* HTTP_USER_AGENT: Mozilla/4.6 [en] (X11; I; SunOS 5.7 i86pc) HTTP_ACCEPT_ENCODING: gzip HTTP_HOST: demo.idea-net.com HTTP_COOKIE: JSESSIONID=To1011mC5915471211401706At HTTP_ACCEPT_LANGUAGE: en REDIRECT_URL: /test/phack.php REDIRECT_STATUS: 200 SERVER_NAME: demo.idea-net.com DOCUMENT_ROOT: xxx/demo/html CONTENT_LENGTH: 0 REMOTE_USER: REMOTE_ADDR: 204.133.16.xxx REMOTE_HOST: 204.133.16.xxx SCRIPT_NAME: /isapi/libphp4.so PATH_TRANSLATED: %docroot%/test/phack.php PATH_INFO: /test/phack.php QUERY_STRING: xyz=2 REQUEST_URI: /test/phack.php/1/2/3?xyz=2 REQUEST_METHOD: GET SCRIPT_FILENAME: %zeushome%/web/bin/libphp4.so SERVER_SOFTWARE: Zeus/3.3 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 AUTH_TYPE: Basic SERVER_PORT: 80 VSERVER_NAME: demo SERVER_ADMIN: webmaster@idea-net.com URL: /isapi/libphp4.so DOCROOT: xxxx/demo/html HTTP_STATUS: 200 <demo> Run Extension Done: %zeushome%/web/bin/libphp4.so notification type: -1 iheaders: srvvars: oheaders: ^ | ---------------------------------------- I changed the docroot to %docroot% in the above (it was correct). I changed the zeushome to %zeushome% in the above (it was correct). Rob On Wed, Sep 13, 2000 at 10:31:11PM -0000, Bug Database wrote: > ID: 6581 > Updated by: joosters > Reported By: rziegler@idea-net.com > Status: Open > Bug Type: Scripting Engine problem > Assigned To: > Comments: > > Quick check; could you ensure that you have set Zeus up to run ISAPI > code 'out of process' ? > > Previous Comments: > --------------------------------------------------------------------------- > > [2000-09-06 16:53:03] rziegler@idea-net.com > This may be a bug with the zeus webserver and its ISAPI > implementation. Watching the ISAPI communication > between Zeus and libphp4.so for a request like: > > http://test/dir/info.php/1/2/3?xyz=2 > > I see the following (from Zeus): > > PATH_TRANSLATED: %docroot%/dir/info.php > PATH_INFO: /dir/info.php > QUERY_STRING: xyz=2 > REQUEST_URI: /dir/info.php/1/2/3?xyz=2 > > which is exactly what php prints out. I sent a bug > report to Zeus and will post whatever they say. > > --------------------------------------------------------------------------- > > [2000-09-06 11:20:42] rziegler@idea-net.com > From config.status: > ./configure --with-mysql=/usr/local/mysql3.22.32 --with-zeus=/usr/local/zeus > --with-gd --with-config-file-path=/usr/local/zeus/php/lib --prefix=/usr/local/zeus/php > --enable-libgcc > > % grep DISCARD *.h > php_config.h:#define DISCARD_PATH 0 > php_config.h:#define DISCARD_PATH 0 > > Output from various scripts: > Zeus with perl on > "http://testsite.idea-net.com/cgi-bin/pinfo.pl/1/2/3?x=y": > > PATH_INFO: /1/2/3 > PATH_TRANSLATED: /opt/www/projects/testsite/html/1/2/3 > QUERY_STRING: x=y > REQUEST_URI: /cgi-bin/pinfo.pl/1/2/3?x=y > > > Zeus with php3 on > "http://testsite.idea-net.com/cgi-bin/pinfo.php3/1/2/3?x=y": > > PATH_INFO: /cgi-bin/pinfo.php3 > PATH_TRANSLATED: /opt/www/projects/testsite/cgi-bin/pinfo.php3 > QUERY_STRING: x=y > REQUEST_URI: /cgi-bin/pinfo.php3/1/2/3?x=y > > > > Zeus with php4 on > "http://testsite.idea-net.com/test/pinfo.php/1/2/3?x=y": > > PATH_INFO: /test/pinfo.php > PATH_TRANSLATED: /opt/www/projects/testsite/html/test/pinfo.php > QUERY_STRING: x=y > REQUEST_URI: > > > If you need access to a web server running Zeus > to work on this problem, I can probably set something > up. (Assuming this is a problem and not something > stupid on my part.) > > Thanks, > Rob > > --------------------------------------------------------------------------- > > > Full Bug description available at: http://bugs.php.net/?id=6581 > -- Robert Ziegler rziegler@idea-net.com

« previous php.dev (#33235) next »