CGI binary - command line=yes browser=no

From: Date: Mon, 02 Oct 2000 17:45:29 +0000
Subject: CGI binary - command line=yes browser=no
Groups: php.install 
Request: Send a blank email to php-install+get-96@lists.php.net to get a copy of this message
Hi all: My setup: php 4.0.2 Solaris 2.7 Netscape Enterprise Server 2.01 I have had no problems compiling the CGI binary version of php. I've put the binary in /usr/local/bin as I don't want the interpreter in cgi-bin. I've put the appropriate shebang line in and chmod 755 the file. I have no problems invoking my test.php from the command line and getting expected output with an appropriate Content-type header. But when I try to run from the browser I get a server error: [02/Oct/2000:10:08:37] failure: for host 198.153.202.65 trying to GET /cgi-bin/test.php, cgi-parse-output reports: the CGI program /opt/ns-home/cgi-bin/test.php did not produce a valid header (program terminated without a valid CGI header. Check for core dump or other abnormal termination) Okay, so the web server runs under a different user (nobody) with a limited environment. So I tried this: deathstar:root:/:2# su - nobody $ cd /opt/ns-home/cgi-bin $ ./test.php ld.so.1: /usr/local/bin/php: fatal: libgdbm.so.2: open failed: No such file or directory Killed Was that the cause of the error?. Then to confirm I tried this: $ LD_LIBRARY_PATH=/usr/local/lib $ export LD_LIBRARY_PATH $ ./test.php X-Powered-By: PHP/4.0.2 Content-type: text/html <HTML> <TITLE>PHP CGI TEST</TITLE> <BODY> My name is Laura </BODY> </HTML> I temporarily started up the web server with my user account as the user (since I know my environment is fully loaded) but I still get the error running from the browser. Then I tried to recompile php to use static libraries (is this right? I'm not a C programmer so don't know the lingo) so it wouldn't look for /usr/local/lib. These are the parameters I used: ./configure \ --prefix=/usr/local \ --with-mysql=/opt/mysql \ --with-config-file-path=/opt/ns-home/php \ --enable-xml \ --enable-track-vars \ --enable-shared=no \ --enable-static=yes But no joy there either. Again, works fine from command line but not from the browser. And I don't know how to diagnose this further. I am pulling my hair out. Thoughts anyone? Thanks ... -Laura

« previous php.install (#96) next »