php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11692 CGI problem with http://myweb/script.php/variable
Submitted: 2001-06-26 07:15 UTC Modified: 2001-12-12 08:26 UTC
From: pogar at pik-net dot pl Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.6 OS: LInux
Private report: No CVE-ID: None
 [2001-06-26 07:15 UTC] pogar at pik-net dot pl
Hello.

I've php compiled with:
/configure' '--prefix=/usr' '--with-config-file-path=/etc' 
'--disable-debug' '--enable-pic' '--enable-shared' 
'--enable-inline-optimization' 
'--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' 
'--with-regex=system' '--with-gettext' '--with-gd=shared' 
'--with-jpeg-dir=/usr' '--with-png' '--with-zlib' 
'--without-db2' '--without-db3' '--with-gdbm' 
'--enable-debugger' '--enable-magic-quotes' 
'--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' 
'--enable-sysvshm' '--enable-track-vars' '--enable-yp' 
'--enable-ftp' '--enable-wddx' '--without-mysql' 
'--without-pgsql' '--without-oracle' '--without-oci8' 
'--disable-discard-path' '--with-xml

And now if I call url: http://myweb/script.php/variable 
everything is ok. But If i do this with php as CGI i've 
got 500 error.

This is enviroment variables set by apache:
DOCUMENT_ROOT='/var/www/html'
HTTP_ACCEPT='image/gif, image/x-xbitmap, image/jpeg, 
image/pjpeg, application/vnd.ms-powerpoint, 
application/vnd.ms-excel, application/msword, 
application/pdf, */*'
HTTP_ACCEPT_ENCODING='gzip, deflate'
HTTP_ACCEPT_LANGUAGE='pl'
HTTP_CONNECTION='Keep-Alive'
HTTP_HOST='trejsrut.silesia.pik-net.pl'
HTTP_USER_AGENT='Mozilla/4.0 (compatible; MSIE 5.01; 
Windows NT 5.0)'
PATH='/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin'
REDIRECT_STATUS='200'
REDIRECT_URL='/tst.php/123/123'
REMOTE_ADDR='213.186.64.5'
REMOTE_HOST='azazel.silesia.pik-net.pl'
REMOTE_PORT='1498'
SCRIPT_FILENAME='/var/www/cgi-bin/php'
SERVER_ADDR='213.186.64.21'
SERVER_ADMIN='pogar@pik-net.pl'
SERVER_NAME='trejsrut.silesia.pik-net.pl'
SERVER_PORT='80'
SERVER_SIGNATURE='Apache/1.3.14 Server at 
trejsrut.silesia.pik-net.pl Port 80'
SERVER_SOFTWARE='Apache/1.3.14 (Unix)  (Red-Hat/Linux) 
mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.6 
mod_perl/1.24'
GATEWAY_INTERFACE='CGI/1.1'
SERVER_PROTOCOL='HTTP/1.1'
REQUEST_METHOD='GET'
QUERY_STRING=''
REQUEST_URI='/tst.php/123/123'
SCRIPT_NAME='/cgi-bin/php'
PATH_INFO='/tst.php/123/123'
PATH_TRANSLATED='/var/www/html/tst.php/123/123'DOCUMENT_ROOT='/var/www/html'
HTTP_ACCEPT='image/gif, image/x-xbitmap, image/jpeg, 
image/pjpeg, application/vnd.ms-powerpoint, 
application/vnd.ms-excel, application/msword, 
application/pdf, */*'
HTTP_ACCEPT_ENCODING='gzip, deflate'
HTTP_ACCEPT_LANGUAGE='pl'
HTTP_CONNECTION='Keep-Alive'
HTTP_HOST='trejsrut.silesia.pik-net.pl'
HTTP_USER_AGENT='Mozilla/4.0 (compatible; MSIE 5.01; 
Windows NT 5.0)'
PATH='/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin'
REDIRECT_STATUS='200'
REDIRECT_URL='/tst.php/123/123'
REMOTE_ADDR='213.186.64.5'
REMOTE_HOST='azazel.silesia.pik-net.pl'
REMOTE_PORT='1498'
SCRIPT_FILENAME='/var/www/cgi-bin/php'
SERVER_ADDR='213.186.64.21'
SERVER_ADMIN='pogar@pik-net.pl'
SERVER_NAME='trejsrut.silesia.pik-net.pl'
SERVER_PORT='80'
SERVER_SIGNATURE='Apache/1.3.14 Server at 
trejsrut.silesia.pik-net.pl Port 80'
SERVER_SOFTWARE='Apache/1.3.14 (Unix)  (Red-Hat/Linux) 
mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.6 
mod_perl/1.24'
GATEWAY_INTERFACE='CGI/1.1'
SERVER_PROTOCOL='HTTP/1.1'
REQUEST_METHOD='GET'
QUERY_STRING=''
REQUEST_URI='/tst.php/123/123'
SCRIPT_NAME='/cgi-bin/php'
PATH_INFO='/tst.php/123/123'
PATH_TRANSLATED='/var/www/html/tst.php/123/123'

If I call php with this variables it's breaking work.
This is strace of this:
munmap(0x40017000, 80794)               = 0
open("/etc/protocols", O_RDONLY)        = 4
fcntl64(4, F_GETFD)                     = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=1567, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
read(4, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 
1567
close(4)                                = 0
munmap(0x40017000, 4096)                = 0
open("/etc/protocols", O_RDONLY)        = 4
fcntl64(4, F_GETFD)                     = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=1567, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
read(4, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 
1567
close(4)                                = 0
munmap(0x40017000, 4096)                = 0
brk(0x817e000)                          = 0x817e000
brk(0x817f000)                          = 0x817f000
brk(0x8180000)                          = 0x8180000
brk(0x8181000)                          = 0x8181000
brk(0x8182000)                          = 0x8182000
brk(0x8183000)                          = 0x8183000
brk(0x8184000)                          = 0x8184000
brk(0x8185000)                          = 0x8185000
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={30, 
0}}, NULL) = 0
rt_sigaction(SIGPROF, {0x80d7140, [PROF], 
SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
brk(0x8186000)                          = 0x8186000
brk(0x8187000)                          = 0x8187000
brk(0x8188000)                          = 0x8188000
brk(0x8189000)                          = 0x8189000
brk(0x818a000)                          = 0x818a000
brk(0x818b000)                          = 0x818b000
time(NULL)                              = 993552461
getpid()                                = 27953
getpid()                                = 27953
open("/var/www/html/tst.php/123/123", O_RDONLY) = -1 
ENOTDIR (Not a directory)
_exit(-1)                               = ?


Regards
Piotr


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-26 08:01 UTC] pogar at pik-net dot pl
I forgot to write that I call php as CGI wirh Action 
directive in apache.

Regards
-- 
Piotr Gardy, Dzial obslugi serwerow	PIK-Net Sieci 
Rozlegle
Toszecka 102, Gliwice Poland, +48 32 338-33-53
e-mail: pogar@pik-net.pl


 [2001-12-12 08:26 UTC] yohgaki@php.net
Why you have "--with-apxs=/usr/sbin/apxs" while you are using GCI?
I suppose it is not a bug...
If you think this is a bug, please provide the reason....


 [2002-07-15 22:28 UTC] phpbugs at mattholland dot com
This IS A BUG, and the reason is that I'm having the exact same problem, and I *don't* have the compile flag set which the previous user did.

Platform: Linux
PHP version: 4.2.1 , in CGI mode
compile flags: ./configure' '--with-zlib=/usr' '--enable-force-cgi-redirect' '--prefix=/home/webpageweaver/usr/local' '--with-config-file-path=/home/webpageweaver/etc/' '--with-mysql' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-curl=/home/webpageweaver/usr/local/' '--enable-trans-sid'

Please re-open this bug (or one of the 4 or 5 other instances in this database where other users have reported the exact same behavior, and someone always decides it's "bogus")
 [2003-04-23 21:23 UTC] flight553 at yahoo dot com
Change your configure statement to '--enable-discard-path' and then PHp will not try to fopen whatever the PATH_INFO is.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 16:01:31 2024 UTC