CGI mode core dumps
| From: | Gary Algier | Date: | Wed, 02 Aug 2000 20:48:31 +0000 |
| Subject: | CGI mode core dumps | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-27491@lists.php.net to get a copy of this message | ||
Since I compiled and built php 4.0.1pl2 with cc, I needed to use dbx to
produce a stack back trace. Here it is:
---------------------------------------------------------------------------
(/opt/SUNWspro/bin/dbx) where
[1] 0x0(0x2396e4, 0x3a5, 0x2aec50, 0x0, 0xef4a3180, 0xef43ea80), at 0xffffffff
=>[2] php_body_write(str = 0x2396e4 "<b>Security Alert!</b> PHP CGI cannot be
accessed directly.\n\n<P>This PHP CGI binary was compiled with force-cgi-redirect enabled.
This\nmeans that a page will only be served up if the REDIRECT_STATUS CGI variable is\nset. This
variable is set, for example, by Apache's Action directive redirect.\n<P>You may disable
this restriction by recompiling the PHP binary with the\n--disable-force-cgi-redirect switch. If
you do this and you have your PHP CGI\nbinary accessible somewhere in your web tree, people will be
" ..., str_length = 933U), line 84 in "output.c"
[3] main(argc = 2, argv = 0xeffffa34), line 428 in "cgi_main.c"
(/opt/SUNWspro/bin/dbx)
---------------------------------------------------------------------------
I can see that I need to rebuild php with "--disable-force-cgi-redirect",
but it should produce output, not core dump.
By the way, this only happens when run as a CGI script under Apache.
Here's the environment:
---------------------------------------------------------------------------
DOCUMENT_ROOT=/export/apache/users/htdocs
GATEWAY_INTERFACE=CGI/1.1
HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
HTTP_ACCEPT_CHARSET=iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING=gzip
HTTP_ACCEPT_LANGUAGE=en
HTTP_CONNECTION=Keep-Alive
HTTP_HOST=users.ulticom.com
HTTP_USER_AGENT=Mozilla/4.73 [en] (X11; U; FreeBSD 4.0-RELEASE i386)
PATH=/bin:/usr/bin:/usr/local/it/bin
QUERY_STRING=
REMOTE_ADDR=172.25.1.153
REMOTE_PORT=2393
REQUEST_METHOD=GET
REQUEST_URI=/~it/env.cgi
SCRIPT_FILENAME=/u/it/public_html/env.cgi
SCRIPT_NAME=/~it/env.cgi
SERVER_ADDR=172.25.0.36
SERVER_ADMIN=gaa@ulticom.com
SERVER_NAME=users.ulticom.com
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.0
SERVER_SOFTWARE=Apache/1.3.12 (Unix) mod_perl/1.21_02 mod_ssl/2.6.3 OpenSSL/0.9.5a
TZ=US/Eastern
UNIQUE_ID=OYiCGawZAB4AAEkTXEE
DISPLAY=dil:15.0
XAUTHORITY=/tmp/ssh-Ttj28804/cookies
---------------------------------------------------------------------------
I had to dummy the enviroment with "env - DOCUMENT_ROOT= ... dbx" to make
it fail.
--
Gary Algier, WB2FWZ gary.algier@ulticom.com +1 856 787 2758
Ulticom Inc., 1020 Briggs Rd, Mt. Laurel, NJ 08054 Fax:+1 856 866 2033
This space intentionally left blank by the censors.