Multiple Versions of PHP in plesk

 

By default, in latest version of plesk we will have 5.4 version of php. So if you need additional php version, you can install seperatly and those additional  version will be available in fastcgi and cgi handlers.

Installtion Steps for php 5.2.17 version

# cd /usr/local/src
# wget http://museum.php.net/php5/php-5.2.17.tar.gz
# tar -zxvf php-5.2.17.tar.gz
# cd php-5.2.17
# ./configure --with-libdir=lib64 --cache-file=./config.cache --prefix=/usr/local/php-5.2.17 --with-config-file-path=/usr/local/php-5.2.17/etc --disable-debug --with-pic --disable-rpath --with-bz2 --with-curl --with-freetype-dir=/usr/local/php-5.2.17 --with-png-dir=/usr/local/php-5.2.17 --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr/local/php-5.2.17 --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-5.2.17 --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-5.2.17/pear --with-mcrypt --without-pdo-sqlite --with-config-file-scan-dir=/usr/local/php-5.2.17/php.d --enable-fastcgi
# make 
# make install

There may be some error while compiling and you need to make necessary changes in the configure as per your need / your server.

# cp /usr/local/src/php-5.2.17/php.ini-recommended /usr/local/php-5.2.17/etc/php.ini

Make necessary changes in the php.ini like timezone setting, memory limit etc.

Inorder to register this php version in plesk, we need to use the below command.

# /usr/local/psa/bin/php_handler --add -displayname "PHP 5.2.17" -path /usr/local/php-5.2.17/bin/php-cgi -phpini /usr/local/php-5.2.17/etc/php.ini -type fastcgi -id "fastcgi-5.2.17"

You will get a message like ” The new PHP handler with the id “fastcgi-5.2.17″ was successfully registered”

Installtion Steps for php 5.3.28 version

# cd /usr/local/src
# wget http://in1.php.net/distributions/php-5.3.28.tar.gz
# tar -zxvf php-5.3.28.tar.gz
# cd php-5.3.28
# ./configure --with-libdir=lib64 --cache-file=./config.cache --prefix=/usr/local/php-5.3.28 --with-config-file-path=/usr/local/php-5.3.28/etc --disable-debug --with-pic --disable-rpath --with-bz2 --with-curl --with-freetype-dir=/usr/local/php-5.3.28 --with-png-dir=/usr/local/php-5.3.28 --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr/local/php-5.3.28 --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-5.3.28 --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-5.3.28/pear --with-mcrypt --without-pdo-sqlite --with-config-file-scan-dir=/usr/local/php-5.3.28/php.d --without-sqlite3 --enable-intl
# make 
# make install

There may be some error while compiling and you need to make necessary changes in the configure as per your need / your server.

# cp -a /etc/php.ini /usr/local/php-5.3.28/etc/php.ini

Make necessary changes in the php.ini like timezone setting, memory limit etc.

Inorder to register this php version in plesk, we need to use the below command.

# /usr/local/psa/bin/php_handler --add -displayname "5.3.28" -path /usr/local/php-5.3.28/bin/php-cgi -phpini /usr/local/php-5.3.28/etc/php.ini -type fastcgi -id "fastcgi-5.3.28"

You will get a message like ” The new PHP handler with the id “fastcgi-5.3.28″ was successfully registered.”

After this try to login to plesk and see if these additional php version are available in fastcgi and cgi handlers.

If all good then you are set to use all these additional php version in plesk.

 

 

 

Facebook Comments