• 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

Two PHP versions linux Plesk HOWTO

Any Updates for Plesk 11?

I am pretty sure this is a permission issue, but maybe something has changed under Plesk 11/Linux?

I followed the instructions above and tried just about every combination of permissions that I could think of.

I keep getting these errors in the log:
(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
Premature end of script headers: index.php

Trying to install PHP 5.2 to accomodate a couple of clients with some older Zend code so any tips that one could give would be much appreciated.
 
I installed 2 different PHP Versions with this howto under Plesk 11 on Centos Linux - so it's working! ;-)

Just noticed I made a little mistake with the first check I suggested you! Please try this:

cd /usr/local/php520-cgi/
./php-cgi -v
./php-cgi -i

ps) I installed PHP in the same directories as you - but I made symlinks - so I can switch fast between versions if there are updates ...
php52 -> php527-cgi/
php54 -> php546-cgi/
 
Last edited:
Found Part of the Issue

Found part of the problem - it had to do with multiple transfers of the domain from its old server. Turns out that plesk does not delete the username out of its sysusers table and subsequent transfers of the domain and the domain never gets recreated properly. While that was going on I wouldn't even see entries for the handler being executed in suexec_log.

However, I am still getting the error:

I checked suexec_log and I see the client executing .phpwrapper but I am still coming up with this error: (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

I put up a little phpinfo script on the site. It works fine without the handler and place and tells me I have 5.3.17 installed. That is the default config presently set to run php as fast_cgi.

I shell to /usr/local/php52-cgi/bin and then run ./php /var/www/vhosts/<domain>/httpdocs/phpinfo.php and ./php-cgi /var/www/vhosts/<domain>/httpdocs/phpinfo.php and in both cases I see output, but still no go with the wrapper.
 
Well at this point, I have verified that there is something amiss with the PHP install. It seems to be happy with a -v and -i, but not with the wrapper.
 
After umpteen installs

It was the php build, very finicky this fast cgi. Now the question changes to has anyone gotten zendoptimizer working in fast cgi like this?
 
What Worked - Follow Up

In case anyone else is going through this issue, here is a php5.1.17 config that worked for me:

'./configure' '--build=x86_64-unknown-linux-gnu' '--host=x86_64-unknown-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/bin/php52-cgi' '--with-config-file-path=/usr/local/bin/php52-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/bin/php52-cgi' '--with-png-dir=/usr/local/bin/php52-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/bin/php52-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr/local/bin/php52-cgi' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/bin/php52-cgi/pear' '--with-mcrypt' '--without-pdo-sqlite' '--without-unixODBC' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-scan-dir=/usr/local/bin/php52-cgi/php.d'

The key to getting everything working right on my box was:
-Adjusting the most fabulous instructions given earlier in the thread for my install dir
-Remembering to "make clean" between php builds
-Adding the last config parameter which is the directory where the zend.ini and ioncube.ini went and getting zend optimizer to load.
-I was not able to get this version of php to properly execute in fast_cgi until I moved the install dir under /usr/local/bin/<yourdir>, I am not sure if this is something to do the with box or my ineptitude.
 
Any help appreciated

I have tried to compile numerous times each time failing with a required library package that I could then install with yum.

Now it is failing with:
Code:
configure: error: Cannot find libmysqlclient under /usr

I am pretty sure the required libraries are installed:
Code:
Package mysql-libs-5.5.27-11.el5.art.i386 already installed and latest version
Package mysql-devel-5.5.27-11.el5.art.i386 already installed and latest version

I have also tried different --with-mysql directories
/usr
/usr/
/usr/include
/usr/include/mysql

Is there a library I am missing, or am I pointing to the wrong location? Anything else I can try?

Thanks
 
I have tried to compile numerous times each time failing with a required library package that I could then install with yum.

Is there a library I am missing, or am I pointing to the wrong location? Anything else I can try?

Thanks

Guess this thread is not about how to compile PHP ... ;-)

That said - more information is needed:

1) uname -a
2) PHP Version you try to compile
3) Whole ./configure String
4) rpm -qa | grep sql

@Matt: glad to hear you got it running! ;-)
 
Last edited:
Guess this thread is not about how to compile PHP ... ;-)
I think it is about how to compile PHP when working with a pre-existing Plesk implementation. Thank is what makes it a little bit unique. Again thank you for any help.

1) uname -a
Code:
Linux www.example.com 2.6.27.41someserver-20111201a #1 SMP Fri Dec 11 03:30:02 EST 2009 i686 i686 i386 GNU/Linux
2) PHP Version you try to compile
Code:
php 5.4.7
3) Whole ./configure String
Code:
./configure '--with-libdir=lib64' 
'--cache-file=../config.cache' 
'--prefix=/usr/local/php5.4.7-cgi' 
'--with-config-file-path=/usr/local/php5.4.7-cgi/etc' 
'--disable-debug' 
'--with-pic' 
'--disable-rpath' 
'--with-bz2' 
'--with-curl' 
'--with-freetype-dir=/usr/local/php5.4.7-cgi' 
'--with-png-dir=/usr/local/php5.4.7-cgi' 
'--enable-gd-native-ttf' 
'--without-gdbm' 
'--with-gettext' 
'--with-gmp' 
'--with-iconv' 
'--with-jpeg-dir=/usr/local/php5.4.7-cgi' 
'--with-openssl' 
'--with-pspell' 
'--with-pcre-regex' 
'--with-zlib' 
'--enable-exif' 
'--enable-ftp' 
'--enable-sockets' 
'--enable-sysvsem' 
'--enable-sysvshm' 
'--enable-sysvmsg' 
'--enable-wddx' 
'--with-kerberos' 
'--with-unixODBC=/usr' 
'--enable-shmop' 
'--enable-calendar' 
'--without-sqlite3' 
'--with-libxml-dir=/usr/local/php5.4.7-cgi' 
'--enable-pcntl'  
'--enable-mbstring' 
'--enable-mbregex' 
'--with-gd' 
'--enable-bcmath' 
'--with-xmlrpc' 
'--with-mysql=/usr' 
'--with-mysqli' 
'--with-snmp' 
'--enable-soap' 
'--with-xsl' 
'--enable-xmlreader' 
'--enable-xmlwriter' 
'--enable-pdo' 
'--with-pdo-mysql' 
'--with-pdo-pgsql' 
'--with-pear=/usr/local/php5.4.7-cgi/pear' 
'--enable-intl' 
'--without-pdo-sqlite'
4) rpm -qa | grep sql
Code:
php-mysql-5.3.17-10.el5.art
perl-DBD-mysql-4.014-1.el4.rf
postgresql-8.1.23-6.el5_8
mysqlclient15-5.0.90-2.el5.art
mysql-5.5.27-11.el5.art
mysql-server-5.5.27-11.el5.art
mysql-devel-5.5.27-11.el5.art
python-sqlite-1.1.7-1.2.1
sqlite-3.7.0.1-1.el5.art
sw-libsqlite3-0-3.7.7.1-11083021
mysql-connector-odbc-3.51.26r1127-2.el5
postgresql-libs-8.1.23-6.el5_8
postgresql-server-8.1.23-6.el5_8
mysql-libs-5.5.27-11.el5.art
 
seems like you try to compile on a 32bit machine - right?
so pointing it to 64bit libdir is no good idea! ;-)

'--with-libdir=lib64' should be '--with-libdir=lib'

and you want to add this to your configure
'--with-config-file-scan-dir=/usr/local/bin/php5.4.7-cgi/php.d'

haven't checked all other compile params - but I guess this should work! ;-)

Andreas
 
Last edited:
seems like you try to compile on a 32bit machine - right?
so pointing it to 64bit libdir is no good idea! ;-)



and you want to add this to your configure


haven't checked all other compile params - but I guess this should work! ;-)

Andreas

Thank you so much, that did the trick.
 
Plesk 11 with default PHP 5.3 and PHP 5.4.7

Hi,

I am developing a crawler which require PCRE v7+ in PHP. The Plesk 11 version of PHP has PCRE version 6.6 which is not enough. So, I decided to install a second version of PHP. I used this guide (http://kb.parallels.com/114753) as the source and tried to install PHP 5.4.7. Everything looks good in configuration (wrapper, vhost, permissions) But I am getting 500 Internal server Error on my domain. Server error log says

Quote:
[Thu Oct 11 15:04:29 2012] [warn] [client 74.208.205.191] (104)Connection reset by peer:
mod_fcgid: error reading data from FastCGI server
[Thu Oct 11 15:04:29 2012] [error] [client 74.208.205.191] Premature end of script headers: index.php
My FCGI Wrapper and vhost.conf are exactly same as in the guide (linked above) offcourse with the change of "domain.com".

p.s: I used the same folder name i.e "php540" and I had to install several packages using yum like libjpeg-devel, libcurl-devel, libpng-devel ...

what could be causing this error? Anyone able to get these two version running parallel in parallel plesk 11?
 
what could be causing this error? Anyone able to get these two version running parallel in parallel plesk 11?


It's working with Plesk 11 - got 3 PHP Versions on our Server.
What's the user/group of your "cgi-bin" directory? Would double check all users/groups of the needed files!

Andreas Schnederle-Wagner
 
domainuser/psaserv for cgi-bin (I tried the domainuser/psacln too) and domainuser/psacln for the wrapper and wrapper directory.
and root/root for vhost.conf (tried the root/apache but did not work either).
 
Last edited:
second version of PHP is not installed @ /usr/local/php540-cgi rather rather @ /usr/local/php540-cgi/bin and is working fine except it throw few warning about libxml2 that are as follows. I dont think that these warning could cause any problem.

./php: /usr/lib64/libxml2.so.2: no version information available (required by ./php)

Do I need to do any changes because of the installation in bin folder?

Edit: I verified, same path is used in .phpwrapper i.e. "/usr/local/php540-cgi/bin/php-cgi"
 
Last edited:
PHP Binaries in bin Folder are perfect ok! ;-)

Do you see any entry in "/var/log/httpd/suexec_log" when opening the Page where PHP 5.4 is active?
If so - please post them
 
Nop.. nothing in suexec_log... just the ones I posted earlier (in error_log of the domain)
[Tue Oct 16 09:30:45 2012] [warn] [client 74.208.205.191] (104)Connection reset by peer:
mod_fcgid: error reading data from FastCGI server
[Tue Oct 16 09:30:45 2012] [error] [client 74.208.205.191] Premature end of script header
s: index.php
 
The last time I had same issue some chmod/chown were wrong ... mhm

Post following data:

ll -a /var/www/vhosts/DOMAINNAME/
ll -a /var/www/vhosts/DOMAINNAME/cgi-bin/
ll -a /var/www/vhosts/DOMAINNAME/cgi-bin/.cgi_wrapper/
cat /var/www/vhosts/DOMAINNAME/cgi-bin/.cgi_wrapper/.phpwrapper
cat /var/www/vhosts/DOMAINNAME/conf/vhost.conf


Andreas Schnederle-Wagner
 
Thanks for taking time to respond me so quickly..

I hope you would find something odd that will fix my problem.. :)

ll -a /var/www/vhosts/DOMAINNAME/
drwxr-xr-x 20 root root 4096 Aug 22 2011 .
drwxr-xr-x 21 root root 4096 Oct 15 10:17 ..
drwxr-x--- 5 DOMAINUSER psaserv 4096 Aug 22 2011 anon_ftp
drwxr-xr-x 2 root root 4096 Aug 22 2011 bin
drwxr-x--- 4 DOMAINUSER psacln 4096 Oct 11 13:23 cgi-bin
drwxr-x--- 3 root psaserv 4096 Oct 16 02:27 conf
drwxr-xr-x 2 root root 4096 Aug 22 2011 dev
drwxr-xr-x 2 root psaserv 4096 Aug 22 2011 error_docs
drwxr-xr-x 2 root root 4096 Oct 11 15:02 etc
drwxrwxrwx 8 DOMAINUSER psaserv 4096 Oct 12 07:51 httpdocs
drwxr-xr-x 2 root root 4096 Aug 22 2011 lib
drwxr-xr-x 2 root root 4096 Aug 22 2011 lib64
drwxr-x--- 2 root psaserv 4096 Aug 22 2011 pd
drwx------ 2 DOMAINUSER root 4096 Aug 22 2011 private
dr-xr-x--- 7 root psaserv 4096 Aug 22 2011 statistics
drwxr-xr-x 2 root psaserv 4096 Aug 22 2011 subdomains
drwxrwxrwt 2 root root 4096 Aug 22 2011 tmp
drwxr-xr-x 4 root root 4096 Aug 22 2011 usr
drwxr-xr-x 3 root root 4096 Aug 22 2011 var
drwxr-xr-x 2 root psaserv 4096 Aug 22 2011 web_users

ll -a /var/www/vhosts/DOMAINNAME/cgi-bin/
total 16
drwxr-x--- 4 DOMAINUSER psacln 4096 Oct 11 13:23 .
drwxr-xr-x 20 root root 4096 Aug 22 2011 ..
d--x-----x 2 DOMAINUSER psacln 4096 Oct 11 13:25 .cgi_wrapper
drwxr-xr-x 2 DOMAINUSER psacln 4096 Aug 22 2011 test

ll -a /var/www/vhosts/DOMAINNAME/cgi-bin/.cgi_wrapper/
total 12
d--x-----x 2 DOMAINUSER psacln 4096 Oct 11 13:25 .
drwxr-x--- 4 DOMAINUSER psacln 4096 Oct 11 13:23 ..
-r-x------ 1 DOMAINUSER psacln 157 Oct 11 13:25 .phpwrapper

cat /var/www/vhosts/DOMAINNAME/cgi-bin/.cgi_wrapper/.phpwrapper
export PHPRC=/var/www/vhosts/DOMAINNAME.com/etc/
export PHP_FCGI_CHILDREN=4
export PHP_FCGI_MAX_REQUESTS=1000
exec /usr/local/php540-cgi/bin/php-cgi

cat /var/www/vhosts/DOMAINNAME/conf/vhost.conf
<Directory /var/www/vhosts/DOMAINNAME.com/httpdocs>
RemoveHandler fcgid-script
<IfModule mod_fcgid.c>
AddHandler fcgid-script .php
<Files ~ (\.php)>
SetHandler fcgid-script
FCGIWrapper /var/www/vhosts/DOMAINNAME.com/cgi-bin/.cgi_wrapper/.phpwrapper .php
Options +ExecCGI
allow from all
</Files>
</IfModule>
</Directory>

I really appreciate your help...
 
Back
Top