• Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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