• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Plesk v11.5 multiple PHP versions

GoForIt

New Pleskian
Hello,

I'm trying to install an additional PHP version (v5.5.3) onto a Linux Server (Ubuntu 10.04 LTS.) I followed the instructions at

http://download1.parallels.com/Ples...inistrator-guide/index.htm?fileName=72042.htm

and can now select the new PHP version for a site, but requesting a PHP file returns a 500 error and I can find log entries:

(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
Premature end of script headers: phpinfo.php

The existing PHP version is 5.3.3, if that's relevant.

Can anyone assist me in troubleshooting? In particular, what parameters should I specify on the "./configure [...]" step? I want the new PHP version running with the same capabilities as the old one. How can I find out what needs to be included?

Regards
 
From Websites & Domains -> Hosting Settings -> Change to run PHP as an Apache module!
Let me know if this quick how-to resolves the error! If it does as it has most of the times, then now you would have to investigate the cause of FastCGI not working as expected!
 
Apache? So the fact the documentation says custom PHP versions are only available for CGI/FastCGI is only a myth?
 
PHP versions are only available for CGI/FastCGI is only a myth?
No, it's not a myth! Lately updating plesk has been breaking FastCGI and all sites with it produced a 500 error. Ofcourse a quick work around was to switch to Apache module, then repair the broken FastCGI and switch back to it (if there's a need) We have done this to over 80% of our newly updated plesk
 
Hello,

I'm trying to install an additional PHP version (v5.5.3) onto a Linux Server (Ubuntu 10.04 LTS.) I followed the instructions at

http://download1.parallels.com/Ples...inistrator-guide/index.htm?fileName=72042.htm

and can now select the new PHP version for a site, but requesting a PHP file returns a 500 error and I can find log entries:

(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
Premature end of script headers: phpinfo.php

The existing PHP version is 5.3.3, if that's relevant.

Can anyone assist me in troubleshooting? In particular, what parameters should I specify on the "./configure [...]" step? I want the new PHP version running with the same capabilities as the old one. How can I find out what needs to be included?

Regards

The parameters during configuration step can get a bit out of hand. This is why I hate compiling out of source so much. If only there was an RPM for this (PLEASE TELL ME IF THERE IS). If you want the same capabilities, I suggest you run phpinfo() on your native PHP version (5.3.3) and very early on, you will see the options that were used for the ./configure command and run them. Be sure to specify '--prefix' so that you get a isolated installation. A caveat on this: the flags might change for different versions. For instance, after PHP 5.3, --enable-fastcgi was replaced with --enable-cgi. A second word of warning is that the more options you specify, the more dependencies you will need an dyou get an error during configuration asking you to install them. You can just sort those out with apt-get. My ./configuartion looked a bit like this:

For dependencies:

HTML:
# yum install gcc openssl-devel bzip2-devel curl-devel libpng-devel libc-client-devel re2c libxml2-devel libevent-devel zlib1g-devel libbz2-devel libgmp3-devel libssl-devel libcurl4-openssl-devel libjpeg-devel libpng-devel libxpm-devel libgd2-xpm-devel libmcrypt-devel memcached libmemcached-devel libpcre3-devel libc-client-devel libkrb5-devel libsasl2-devel libmysqlclient-devel libpspell-devel libsnmp-devel libtidy-devel libxslt-devel libtool libxml2-devel

And source compilation:

HTML:
# ./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php540-cgi' '--with-config-file-path=/usr/local/php540-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--enable-fastcgi' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php540-cgi' '--with-png-dir=/usr/local/php540-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php540-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/php540-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/php540-cgi/pear' '--with-mcrypt' '--enable-intl' '--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php540-cgi/php.d'

A final warning, set all the features you need here. Its a pain to enable mysqli if you forget it here.
 
No, it's not a myth! Lately updating plesk has been breaking FastCGI and all sites with it produced a 500 error. Ofcourse a quick work around was to switch to Apache module, then repair the broken FastCGI and switch back to it (if there's a need) We have done this to over 80% of our newly updated plesk

But Plesk PHP handler will only accept CGI/FastCGI. How do you get it running as Apache?
 
Last edited:
Can anyone assist me in troubleshooting? In particular, what parameters should I specify on the "./configure [...]" step? I want the new PHP version running with the same capabilities as the old one. How can I find out what needs to be included?

I really hate compiling PHP from source. If you want your 5.5.3 to run similar to your native (5.3.3), then run phpinfo() on your native and at the very top, you will see the ./configure flags it was compiled with. However, few things you should be careful about.

1. The flags may change with PHP versions. For example, since 5.3, --enable-fastscgi has been replaced with --enable-cgi
2. ALWAYS use --prefix (and --with-config-file-path=/usr/local/php-5.5.3/etc) to prevent it from messing with your native. Makes it easier to remove later as well.
3. Enable all the extensions you want here. Its a bit of a pain to enable them later if you are compiling from source.
4. The more features you enable, the more dependencies you require. You can resolve them with yum or apt-get. If your ./configure is anything like mine, you will have to run it about a 1000 times until you get no errors regarding dependencies.

To save you some time, these were my PHP dependencies, each of which had their own dependencies! You probably have to modify it a bit to make the code compatible with Ubuntu (I use RHEL).

Code:
# yum install gcc openssl-devel bzip2-devel curl-devel libpng-devel libc-client-devel re2c libxml2-devel libevent-devel zlib1g-devel libbz2-devel libgmp3-devel libssl-devel libcurl4-openssl-devel libjpeg-devel libpng-devel libxpm-devel libgd2-xpm-devel libmcrypt-devel memcached libmemcached-devel libpcre3-devel libc-client-devel libkrb5-devel libsasl2-devel libmysqlclient-devel libpspell-devel libsnmp-devel libtidy-devel libxslt-devel libtool libxml2-devel

And this was the configure (5.4.0):

Code:
# ./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php540-cgi' '--with-config-file-path=/usr/local/php540-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--enable-fastcgi' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php540-cgi' '--with-png-dir=/usr/local/php540-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php540-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/php540-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/php540-cgi/pear' '--with-mcrypt' '--enable-intl' '--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php540-cgi/php.d'
 
Last edited:
I have Plesk version 11.5.30.
I have compiled PHP version 5.4.20 from sources.
I have tried to switch PHP for virtual host as described on KB article http://kb.parallels.com/114753
It does not work for me.

Each time when I open any PHP file with such configuration I am getting such error message in web server virtual host error log:
[Tue Oct 15 15:18:58 2013] [warn] [client unknown] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Tue Oct 15 15:18:58 2013] [error] [client unknown] Premature end of script headers: file.php

Does anybody know how to fix it?
 
Since, I have Plesk panel version 11.5.30
I have found working solution for my problem here: http://download1.parallels.com/Plesk/Doc/en-US/online/plesk-administrator-guide/index.htm?fileName=72042.htm
This solution http://kb.parallels.com/en/114753 does not work for me.

Thanx TarasS
I try this solution but there's a error when I compile this: ./configure --prefix /usr/local/php516

this:

loading cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

?

thanx
 
Where is your cc?

To check it use command:
whereis cc

You should add path to it into $PATH variable.

Also, give me command below output:
echo $PATH
uname -a
cat /etc/*release
 
this are my date:

[root@95 php-5.1.6]# whereis cc
cc:
[root@95 php-5.1.6]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@95 php-5.1.6]# uname -a
Linux 95.110.183.27 2.6.32-042stab078.28 #1 SMP Mon Jul 8 10:17:22 MSK 2013 x86
_64 x86_64 x86_64 GNU/Linux
 
Do you have yum package manager?
If yes, then run command:
yum -y groupinstall "Development tools"
to install GCC with all required libraries
 
Yes I have yum
I download development tools and install these...ok
I executed the code and the console tells me:

[root@95 php-5.1.6]# ./configure --prefix /usr/local/php516
loading cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... /usr/local
checking whether the C compiler (/usr/local ) works... no
configure: error: installation or configuration problem: C compiler cannot crea
te executables.
 
It looks you should try:

1. Edit your $PATH variable value to:
export PATH="/usr/bin:$PATH"
re-run ./configure command

2. Run two commands:
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
re-run ./configure command

If nothing of above will not help you check your config.log log for error details and post here.
 
the second option compiles.
not if I have also run "make" and "make install" with these two there is a code error: can not find "make".

I have to edit the php.ini ... with the code:
cp php.ini-development / usr / local / lib / php.ini

there is an error,
cp: can not stat `php.ini-development ': No such file or directory
 
ok
this is the result.

/var/www/vhosts/system/fundalcobendas.intergrafic.com/etc/php.ini
/var/www/vhosts/system/eventshorizon.net/etc/php.ini
/var/www/vhosts/system/intergrafic.com/etc/php.ini
find: File system loop detected; `/var/named/chroot/var/named' is part of the s
ame file system loop as `/var/named'.
/etc/php.ini.saved_by_psa.12.11;18:45
/etc/php.ini.saved_by_psa
/etc/psa-webmail/horde/horde/php.ini.tpl
/etc/psa-webmail/horde/horde/php.ini
/etc/php.ini
/usr/local/psa/admin/conf/php.ini
/usr/local/src/php516/php-5.1.6/php.ini-dist
/usr/local/src/php516/php-5.1.6/php.ini-recommended
/usr/share/doc/php-common-5.3.3/php.ini-production
/usr/share/doc/php-common-5.3.3/php.ini-development

which is the php?

thanx
 
Back
Top