Amministrando un web server con PLESK prima o poi arriva la richiesta di installare una seconda versione di PHP e di renderla disponibile ai clienti attraverso il pannello PLESK.
In questa guida l’installazione è stata fatta su una macchina CentOS 6.6 e Plesk 11.5.30:
Per prima cosa creiamo la directory dove potere scaricare il pacchetto PHP
cd /usr/local/src
# mkdir php562
# cd php562
wget http://it1.php.net/get/php-5.6.2.tar.gz/from/this/mirror
mv mirror php-5.6.2.tar.gz
tar -xvzf php-5.6.2.tar.gz
cd php-5.6.2
Siamo pronti per iniziare, configuriamo per la compilazione:
./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php562-cgi' '--with-config-file-path=/usr/local/php562-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--enable-fastcgi' '--with-bz2' '--with-curl' '--with-xpm-dir=/usr/local/php562-cgi' '--with-png-dir=/usr/local/php562-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php562-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/php562-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/php562-cgi/pear' '--with-mcrypt' '--enable-intl' '--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php562-cgi/php.d' --enable-shared --enable-zip
Ora il classico make e poi make install, mi raccomando non lanciate make test
make
make install
Copiamo il php.ini sotto nella directory php562-cgi
cp php.ini-development /usr/local/php562-cgi/php.ini
Ora non rimane che censire nel pannello PLESK la nuova versione di PHP
/usr/local/psa/bin/php_handler --add -displayname 5.6.2 -path /usr/local/php562-cgi/bin/php-cgi -phpini /usr/local/php562-cgi/php.ini -type fastcgi -id 5.6.2
Nel mio caso la prima installazione di PHP non è stata così liscia, ho dovuto installare alcuni pacchetti:
yum install bzip2-devel.x86_64 bzip2.x86_64
yum install libjpeg*
yum install libpng-devel
yum install freetype
yum install libXpm-devel
yum install libgmp3-dev gmp.x86_64 gmp-devel.x86_64
yum install openssl openssl-devel pam-devel
yum install pam-devel
yum install libicu-devel libc-client-devel.x86_64 libc-client.x86_64
yum install libtomcrypt-devel.x86_64 libmcrypt-devel.x86_64 php-mcrypt.x86_64
yum install unixODBC-devel
yum install postgresql-devel postgresql-libs
yum install pspell php-pspell.x86_64 aspell-devel net-snmp-devel libxslt-devel libxml2-devel pcre-devel t1lib-devel.x86_64 libtidy-devel php-pecl-zip
No responses yet