• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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