• 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

Plesk 11.5 Easy Install Script for Multiple PHP CentOS 6.4 x64

Hello,
I tried to install various PHP versions through your script, but unfortunately the installation is not successful.

I created a file install.sh with the instructions above.
My current configuration is:
CentOS 6.3 64-bit
Plesk 11.5 # 24

This is the error notifying that come on all installations
Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr/local/php-5.2.17-cgi
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... yes
checking for krb5-config... no
checking for DSA_get_default_method in -lssl... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
./installphp.sh: line 36: make: command not found
./installphp.sh: line 37: make: command not found
cp: impossibile creare il file normale `/usr/local/php-5.2.17-cgi/etc/php.ini': No such file or directory
sed: impossibile leggere /usr/local/php-5.2.17-cgi/etc/php.ini: No such file or directory
2013-11-29T16:32:32+01:00 ERR (3) [util_exec]: proc_close() failed
Unable to register the PHP handler: Binary /usr/local/php-5.2.17-cgi/bin/php-cgi doesn't exists

Thanks
Luca
 
Do yum -y install make.
Be sure to install all dependencies.


I suggest you also look into PHP Panda:
http://forum.parallels.com/showthread.php?293750-PHP-Panda!-Multi-PHP-installer-for-Plesk
Which is probably a better solution for those of you that can't / won't compile their own PHP versions.


checking for krb5-config... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
cp: impossibile creare il file normale `/usr/local/php-5.3.27-cgi/etc/php.ini': No such file or directory
2013-12-02T15:43:01+01:00 ERR (3) [util_exec]: proc_close() failed
Unable to register the PHP handler: Binary /usr/local/php-5.3.27-cgi/bin/php-cgi doesn't exists
 
Do yum -y install make.
Be sure to install all dependencies.


I suggest you also look into PHP Panda:
http://forum.parallels.com/showthread.php?293750-PHP-Panda!-Multi-PHP-installer-for-Plesk
Which is probably a better solution for those of you that can't / won't compile their own PHP versions.

checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
cp: impossibile creare il file normale `/usr/local/php-5.3.27-cgi/etc/php.ini': No such file or directory
2013-12-02T15:43:01+01:00 ERR (3) [util_exec]: proc_close() failed
Unable to register the PHP handler: Binary /usr/local/php-5.3.27-cgi/bin/php-cgi doesn't exists
 
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
cp: impossibile creare il file normale `/usr/local/php-5.3.27-cgi/etc/php.ini': No such file or directory
2013-12-02T15:43:01+01:00 ERR (3) [util_exec]: proc_close() failed
Unable to register the PHP handler: Binary /usr/local/php-5.3.27-cgi/bin/php-cgi doesn't exists

I tried to update the repository openssl but the problem persists.
 
Thank you for your help.
I installed the missing dependencies as suggested by the guide posted by you.

It gives me this error: configure: error: utf8_mime2text () Has new signature, but U8T_CANONICAL is missing. This Should not happen. Check config.log for additional information.

I have to also install the package IMAP? This does not affect the current version of PHP installed on Plesk now?
 
Are you testing this on a live server?
That is a bad idea, considering you don't seem to have much compilation experience.

Create a CentOS VM and test there.
No need to install Plesk the guide works without Plesk for compilation.


All packages where later installed on a live environment without issues.
I suggest you delete the folder you were trying to compile in and start over.
 
I managed to install both the 5.2 vers 5.3. The problem was due to library "libmcrypt-devel" in the repository that Atomic was older than that of Plesk and then not installed.
I installed manually by downloading the library from the EPEL repository "http://dl.fedoraproject.org/pub/epel...el6.x86_64.rpm"

And I have successfully installed php, it works perfectly.

But I noticed something in the log domain error_log imposed if one of php installed in the log comes out this item "[warn] RSA server certificate commonName (CN)` Parallels Panel 'does NOT match server name!? "

Thank you for your patience
Luca
 
I just really, really want to say thank you for posting this. You are a goddamn hero. I struggled for a few hours before I found this post. Really really wish I'd seen it earlier, but still, thank you so much for doing this.
 
But I noticed something in the log domain error_log imposed if one of php installed in the log comes out this item "[warn] RSA server certificate commonName (CN)` Parallels Panel 'does NOT match server name!? "

This is normal,
I believe this is because the site you visit does not have it's own SSL cert, and therefore the selfsigned Parallels cert is used.
The Parallels cert ofcourse does not match yourdomain.com

I just really, really want to say thank you for posting this. You are a goddamn hero. I struggled for a few hours before I found this post. Really really wish I'd seen it earlier, but still, thank you so much for doing this.

You're welcome!
 
Quick install for x86_64 systems:

1) wget -q -O - http://www.atomicorp.com/installers/atomic |sh

2)
yum --exclude=atomic-php54-php-mysql install atomic-php54*x86_64
yum --exclude=atomic-php55-php-mysql install atomic-php55*x86_64

I haven't been able to get this to work.. I keep getting this error message.

--> Finished Dependency Resolution
Error: Package: atomic-php55-php-interbase-5.5.7-5.el6.x86_64 (atomic)
Requires: libfbclient.so.2()(64bit)
You could try using --skip-broken to work around the problem

I don't know where to get the missing libfbclient.so.2()(64bit)
 
The following script I made will automate these tasks:

- Install needed dependencies
- Download and extract sources
- Configure and make sources
- Install and register new PHP
- You will then be able to find the new PHP version in Plesk -> Domain -> Websites & Domains -> Web Hosting Access -> PHP -> FastCGI


Code:
yum -y install gcc make gcc-c++ cpp kernel-headers.x86_64 libxml2-devel openssl-devel bzip2-devel libjpeg-devel libpng-devel freetype-devel openldap-devel postgresql-devel aspell-devel net-snmp-devel libxslt-devel libc-client-devel libicu-devel gmp-devel curl-devel libmcrypt-devel unixODBC-devel pcre-devel sqlite-devel db4-devel enchant-devel libXpm-devel mysql-devel readline-devel libedit-devel recode-devel libtidy-devel

phpconfigureflagscommon="--with-libdir=lib64 --cache-file=./config.cache --prefix=/usr/local/php-\$phpversion-\$phptype --with-config-file-path=/usr/local/php-\$phpversion-\$phptype/etc --disable-debug --with-pic --disable-rpath  --with-bz2 --with-curl --with-freetype-dir=/usr/local/php-\$phpversion-\$phptype --with-png-dir=/usr/local/php-\$phpversion-\$phptype --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr/local/php-\$phpversion-\$phptype --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/php-\$phpversion-\$phptype --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/php-\$phpversion-\$phptype/pear --with-mcrypt --without-pdo-sqlite --with-config-file-scan-dir=/usr/local/php-\$phpversion-\$phptype/php.d"

declare -A phpconfigureflagsspecific
phpconfigureflagsspecific[5.2.17-cgi]="--enable-fastcgi"
phpconfigureflagsspecific[5.3.27-cgi]="--without-sqlite3 --enable-intl" [COLOR="#FF0000"]DELETE THIS LINE?[/COLOR]
phpconfigureflagsspecific[5.4.17-cgi]="--without-sqlite3 --enable-intl"
phpconfigureflagsspecific[5.5.1-cgi]="--without-sqlite3 --enable-intl"
phpconfigureflagsspecific[5.3.27-fpm]="--enable-fpm --without-sqlite3 --enable-intl" [B][COLOR="#FF0000"]DELETE THIS LINE[/COLOR][/B]
phpconfigureflagsspecific[5.4.17-fpm]="--enable-fpm --without-sqlite3 --enable-intl"
phpconfigureflagsspecific[5.5.1-fpm]="--enable-fpm --without-sqlite3 --enable-intl"

declare -A phpdownloadurl
phpdownloadurl[5.2.17-cgi]="http://museum.php.net/php5/php-5.2.17.tar.gz"
phpdownloadurl[5.3.27-cgi]="http://be2.php.net/get/php-5.3.27.tar.gz/from/this/mirror" [COLOR="#FF0000"]DELETE THIS LINE?[/COLOR]
phpdownloadurl[5.4.17-cgi]="http://be2.php.net/get/php-5.4.17.tar.gz/from/this/mirror"
phpdownloadurl[5.5.1-cgi]="http://be2.php.net/get/php-5.5.1.tar.gz/from/this/mirror"
phpdownloadurl[5.3.27-fpm]="${phpdownloadurl[5.3.27-cgi]}" [COLOR="#FF0000"]DELETE THIS LINE?[/COLOR]
phpdownloadurl[5.4.17-fpm]="${phpdownloadurl[5.4.17-cgi]}"
phpdownloadurl[5.5.1-fpm]="${phpdownloadurl[5.5.1-cgi]}"

install_php () {
cd /usr/local/src/
phpversion=$1
phptype=$2
[[ -z "$2" ]] && echo "Usage: install_php phpversion phptype" && return 1

wget ${phpdownloadurl[$phpversion-$phptype]} -O /usr/local/src/php-$phpversion-$phptype.tar.gz
mkdir /usr/local/src/php-$phpversion-$phptype/
tar xzvf /usr/local/src/php-$phpversion-$phptype.tar.gz -C /usr/local/src/php-$phpversion-$phptype/ --strip 1
cd /usr/local/src/php-$phpversion-$phptype/
eval ./configure $phpconfigureflagscommon ${phpconfigureflagsspecific[$phpversion-$phptype]}

make -j $(grep processor /proc/cpuinfo | wc -l)
[ ! -d "/usr/local/php-$phpversion-$phptype/" ] && make install


# These ifs need a rewrite, CentOS 5.9 still ships PHP 5.2.10 as default and so /etc/php.ini will not work for PHP 5.3+ #
if [ "$phpversion" == "5.2.17" ]
then
cp /usr/local/src/php-$phpversion-$phptype/php.ini-recommended /usr/local/php-$phpversion-$phptype/etc/php.ini
sed -i "s#;date.timezone =#date.timezone = $timezone#" /usr/local/php-$phpversion-$phptype/etc/php.ini
else
cp -a /etc/php.ini /usr/local/php-$phpversion-$phptype/etc/php.ini
fi

[ "$phptype" == "cgi" ] && /usr/local/psa/bin/php_handler --add -displayname "$phpversion" -path "/usr/local/php-$phpversion-$phptype/bin/php-cgi" -phpini "/usr/local/php-$phpversion-$phptype/etc/php.ini" -type fastcgi -id "fastcgi-$phpversion"
[ "$phptype" == "fpm" ] && /usr/local/psa/bin/php_handler --add -displayname "$phpversion-$phptype" -path "/usr/local/php-$phpversion-$phptype/bin/php-cgi" -phpini "/usr/local/php-$phpversion-$phptype/etc/php.ini" -type fastcgi -id "fpm-$phpversion"

}


install_php 5.2.17 cgi
install_php 5.3.27 cgi [COLOR="#FF0000"]DELETE THIS LINE?[/COLOR]
install_php 5.4.17 cgi
install_php 5.5.1 cgi


Note that this version of the script does NOT work with CentOS 5.9 (declare -A is not available in bash 3).
PHP 5.5.1 will also not compile on CentOS 5.9 because of old dependencies.



An updated guide and full PHP-FPM support will be made available on http://www.stone-is.com/en/blog/hos...-php-versions-for-plesk-115-centos-64-x64/29/

If enough requests make it, I will create an alternate version for CentOS 5.9

Hi.. Thanks for your guide..

But if I do not want to install PHP 5.3.17, I delete the lines marked red?

I tried run the script. Now I have ability the choose of PHP 5.2.17 in the control panel PLESK. I selected PHP 5.2.17 in the domain, but my old OScommerce does not work. In cpanel server with PHP 5.2.17 works.. :(

It seems as if the settings of PHP 5.2.17 is not working

Can I help me?

Thanks.. Andrea
 
Last edited:
Hi.. Thanks for your guide..

But if I do not want to install PHP 5.3.17, I delete the lines marked red?

I tried run the script. Now I have ability the choose of PHP 5.2.17 in the control panel PLESK. I selected PHP 5.2.17 in the domain, but my old OScommerce does not work. In cpanel server with PHP 5.2.17 works.. :(

It seems as if the settings of PHP 5.2.17 is not working

Can I help me?

Thanks.. Andrea

Can you get a phpinfo?
What error do you get in error_log?

I also need more info:

cat /etc/issue
cat /usr/local/psa/version
/usr/local/psa/bin/php_handler --list


If you don't want a certain version, you can just comment the line:
install_php 5.3.27 cgi
 
Can you get a phpinfo?
What error do you get in error_log?

I also need more info:

cat /etc/issue
cat /usr/local/psa/version
/usr/local/psa/bin/php_handler --list


If you don't want a certain version, you can just comment the line:
install_php 5.3.27 cgi
Sorry. Double Post.
 
Last edited:
Can you get a phpinfo?
What error do you get in error_log?

I also need more info:

cat /etc/issue
cat /usr/local/psa/version
/usr/local/psa/bin/php_handler --list


If you don't want a certain version, you can just comment the line:
install_php 5.3.27 cgi

In phpinfo I have the 5.2.17 but my old version of oscommerce does not work. (I have no login access and error session) :-(

I also in the terminal I see this: You will be compiling the CGI version of PHP without any redirection checking. By putting this cgi binary somewhere in your web space, users may be Able to circumvent existing. Htaccess security by loading files Directly through the parser. See http://www.php.net/manual/security.php for more details.

Now I try to reinstall everything and show you more info

Thanks.. Thanks.. Andrea

EDIT: In the terminal I have this error:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
cp: cannot create regular file `/usr/local/php-5.2.17-cgi/etc/php.ini': No such file or directory
sed: can't read /usr/local/php-5.2.17-cgi/etc/php.ini: No such file or directory
2013-12-31T17:32:14+01:00 ERR (3) [util_exec]: proc_close() failed
Unable to register the PHP handler: Binary /usr/local/php-5.2.17-cgi/bin/php-cgi doesn't exists

Idea?

EDIT:::: EDIT:::

I resolve with this:
# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Thanks StéphanS..
 
Last edited:
Back
Top