php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4456 PHP4 won't run in cgi mode with Apache
Submitted: 2000-05-15 16:11 UTC Modified: 2000-06-18 21:08 UTC
From: cahagn_o at epita dot fr Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.1-dev OS: NetBSD 1.3.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cahagn_o at epita dot fr
New email:
PHP Version: OS:

 

 [2000-05-15 16:11 UTC] cahagn_o at epita dot fr
PHP4 snapshot  runs fine in command line but Apache fails loading any php file : Premature End of Script Headers resulting in an Internal Server Error.

I checked the Apache FAQ many times and also PHP's.

PHP3 runs fine with the same setup, I use NetBSD 1.3.3 on x86 with gcc 2.7.2.2 with much memory (256MB) on Apache 1.3.12.

PHP4 has always been running fine when compiled as a module since Beta 1 and Apache on the same platform but never made it when compiled as CGI. I thought I should warn this because we're approaching the final release.
The same basic PHP file would load from module, not from cgi (it also loads with PHP3 cgi)

PHP4 doesn't crash but I really don't know how to debug Apache+PHP4_cgi.

Here's my ./configure (compiling without gd, zlib, etc. support didn't help)

./configure --with-config-file-path=/opt/www/etc/httpd/conf/php_cgi \
            --enable-discard-path \
            --with-gd=/home/guest/www/mbin/i386-NetBSD \
            --with-mysql \
            --with-dbase \
            --with-zlib=/home/guest/www/mbin/i386-NetBSD \
            --enable-ftp

I run Apache with suEXEC and PHP3 has been running flawlessly for more than 6 months now.
I tried deleteing some headers from PHP4 source code, many things, I really think it comes from PHP4 because CGI scripts written in sh, Python, Perl, C, PHP3 have always been running fine.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-03 16:01 UTC] cahagn_o at epita dot fr
I just tested zith PHP 4.0.0 with the same compiler/PC/script and I now get a :

"No input file specified"

in my browser when running a simple script like :

#!/usr/www/bin/php/php4
<?phpinfo();?>

, although it still runs fine from a shell, I tried every parameter from command line and in my script, it doesn't seem to improve.
(and again, PHP3 runs flawlessly with the same setup/compilation options)

Has anyone been able to run PHP4 as CGI through suEXEC (Apache) ? I'm really wondering...

Thanks for any comment or suggestion. I've been trying to run PHP4 as CGI on this machine since Beta 1 without success. And the last CVS version (June 2nd) won't compile because of libpthreads problems.

PS: How to run the PHP internal debugger without the socket command (as specified in the latest documentation from May 25th) ?

 [2000-06-17 19:55 UTC] andi at cvs dot php dot net
Should be fixed in latest CVS. You can also get the latest snapshot at snaps.php.net. If you are still having problems please open a new bug report.
 [2000-06-18 20:14 UTC] cahagn_o at epita dot fr
I tried the latest snapshot found on snaps.php.net : php4-200006180145

and is still won't work properly.

Here's my ./configure, it still works fine with PHP3 and the same configure (except mysql but I guess it doesn't interfere).

./configure --with-config-file-path=/usr/www/etc/httpd/conf/php_cgi \
            --enable-discard-path \
            --with-gd=/usr/www/mbin/i386-NetBSD \
            --with-mysql \
            --with-dbase \
            --with-zlib=/usr/www/mbin/i386-NetBSD \
            --enable-ftp \
            --with-imap=/usr/www/mbin/i386-NetBSD/lib

(adding --force-cgi-redirect didn't help)

Do I need to set doc_root and user in php.ini ? I use the default one and using these settings didn't change anything.

I still get a premature end of script though. Some time ago, with previous PHP4 releases, I obtained "No input file".

I am still using Apache 1.3.12 on NetBSD, with suEXEC and this setting in httpd.conf

AddHandler cgi-script .cgi .php

I'm going to try this setup on a Linux box later to see if the problem also happens.
 [2000-06-18 21:08 UTC] cahagn_o at epita dot fr
I just tried php4-200006181045 from snaps.php.net on Linux with default Apache 1.3.12 from RedHat 6.2 (no suEXEC) and modified httpd.conf to handle cgi scripts:

AddHandler cgi-script .cgi

It doesn't seem to work neither (Premature end of script) with the default php.ini

mak#!/usr/local/bin/php
<?phpinfo()?>

Here's the configure line :

./configure     --with-config-file-path=/usr/local/etc  \
                --with-dbase    \
	--enable-discard-path \
                --enable-ftp
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 19:01:26 2024 UTC