• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 6380, created on May 28, 2009, last review on Aug 12, 2014

  • Applies to:
  • Plesk 9.2 for Linux/Unix

Symptoms

Enable PHP support over FastCGI for domain. Create a PHP script in the httpdocs directory and try to execute it in a web browser. The following errors are shown in the Apache logs:
 
/var/log/apache2/suexec.log
--->8---
[2009-07-02 08:56:58]: uid: (10015/web250) gid: (2524/2524) cmd: php5 
[2009-07-02 08:56:58]: cannot stat program: (php5) 

[Thu Jul 02 08:56:58 2009] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error. 
[Thu Jul 02 08:56:58 2009] [error] [client 123.123.123.123] Premature end of script headers: test.php 
---8<---
 
$HTTPD_VHOSTS_D/<domain name>/statistics/logs/error_log: 
--->8---
[Thu Jul 02 08:56:58 2009] [notice] mod_fcgid: call $HTTPD_VHOSTS_D/<domain name>/httpdocs/test.php with wrapper /srv/www/cgi-bin/php5 
[Thu Jul 02 08:57:04 2009] [notice] mod_fcgid: process $HTTPD_VHOSTS_D/<domain name>/httpdocs/test.php(6757) exit(communication error), terminated by calling exit(), return code: 117
---8<---

Also Apache cannot be started with error "can't get fastcgi file info: dynamic, errno: 2":

~# /etc/init.d/httpd start
Starting httpd: Syntax error on line 57 of $HTTPD_VHOSTS_D/<domain name>/conf/httpd.include:
can't get fastcgi file info: dynamic, errno: 2
                                                           [FAILED]
~#

Cause

The reason is that the file httpd.include contains "#57 : FCGIWrapper dynamic .php".

This line should contain the path to the php-cgi binary instead of word "dynamic." The problem is caused by the value "dynamic" for the variable CGI_PHP_BIN stored in the file /etc/psa/psa.conf. This causes an invalid FCGIWrapper to be included in httpd.

You may check the variable with the following command:

~# grep CGI_PHP_BIN /etc/psa/psa.conf
CGI_PHP_BIN dynamic
~#

For example, the correct value for CentOS5 should be:

~# grep CGI_PHP_BIN /etc/psa/psa.conf
CGI_PHP_BIN /usr/bin/php-cgi
~#

This problem will be fixed in future updates of Parallels Plesk Panel.

Resolution

To resolve the problem, it is recommended that you replace the incorrect value with the valid path to the php-cgi binary. You may correct the value for CGI_PHP_BIN manually or reconfigure the php by force, reinstalling the package psa-php(4|5)-configurator.

Value /usr/bin/php-cgi depends on the operating system where Parallels Plesk Panel is installed. For example, on Suse 10.3, it should be /usr/bin/php-cgi5 or /usr/bin/php5-cgi on Debian OS.

For manual reconfiguration, open the file /etc/psa/psa.conf and find the variable CGI_PHP_BIN. Replace the value with the valid php-cgi binary.

To reinstall the package, find it on the file system and execute the following command:

~# rpm --force -Uhv /FULL/PATH/TO/<psa-php-configurator package>
If you use autoinstaller or web-updater, this package is stored in the directory /root/parallels/PSA_9.2.1/dist-rpm-<your_os>/contrib/ since upgrade. For example, on CentOS5, the command is:

~# rpm --force -Uhv /root/parallels/PSA_9.2.1/dist-rpm-CentOS-5-i386/contrib/psa-php5-configurator-1.5.1-cos5.build92090422.13.noarch.rpm
If the package does not exist in the directory, you may download the file from the website http://autoinstall.plesk.com.

For CentOS5, the file is located in the directory http://autoinstall.plesk.com/PSA_9.2.1/dist-rpm-CentOS-5-x86_64/contrib/

Check the CGI_PHP_BIN value after the procedure (and check that the php-cgi binary file really exists).

Now it is recommended to reconfigure the Apache service with command:

~# /usr/local/psa/admin/sbin/websrvmng -v -a

11a46d8a188d618564f4f0cead9a50f3 a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 6ef0db7f1685482449634a455d77d3f4 56797cefb1efc9130f7c48a7d1db0f0c 0efe2234e2ce513f2186f26c68447702

Email subscription for changes to this article
Save as PDF