• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

CGI problem: Premature end of script headers

D

dinominant

Guest
The working setup:
Plesk 8.1.0
PHP 4.4.6 compiled as CGI, chmoded to 755 and placed in each domains cgi-bin folder, user: domain_name, group: psacln
php4.conf placed in /etc/httpd/conf.d and it contains:
Action php4-script /cgi-bin/php4
AddHandler php4-script .php4
DirectoryIndex index.php4

The new setup that does not work:
Plesk 8.4.0
PHP 4.4.8 compiled as CGI, chmoded to 755 and placed in each domains cgi-bin folder, user: domain_name, group: psacln
php4.conf placed in /etc/httpd/conf.d and it contains:
Action php4-script /cgi-bin/php4
AddHandler php4-script .php4
DirectoryIndex index.php4

PHP4 configure command used on both systems:
'./configure' '--build=x86_64-redhat-linux' '--host=x86_64-redhat-linux' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc/php4' '--with-config-file-scan-dir=/etc/php4.d' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-libxml-dir=/usr' '--enable-gd-native-ttf' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--enable-ucd-snmp-hack' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--disable-dba' '--enable-corce-cgi-redirect' '--enable-fastcgi' '--with-pic' '--with-bz2' '--with-curl' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--without-pspell' '--with-zlib' '--with-layout=GNU' '--with-kerberos' '--with-unixODBC=shared,/usr' '--with-pear=/usr/share/pear' '--with-xml' '--with-cgi' '--with-mysql' '--disable-debug' '--disable-rpath' '--disable-dom'

I've tested the CGI binary with this command: echo "<?php phpinfo(); ?>" | cgi-bin/php4 | less and I get all kinds of phpinfo() output so it appears that php was built properly. Yet when I try to open phpinfo.php4 in my browser I get 500 Internal Server Error. When I look at the the logs I get this:
[Fri May 16 06:10:10 2008] [error] [client 172.16.0.1] Premature end of script headers: php4

Am I missing anything? Has something changed in Plesk 8.4.0 that could be causing this?
 
I found the solution :)

Add these options to the end of the ./configure command: '--enable-force-cgi-redirect' '--enable-fastcgi' '--disable-cli', recompile, copy , chmod, and it worked!
 
Back
Top