Skip to content

Instantly share code, notes, and snippets.

@bouroo
Created October 13, 2023 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bouroo/12986edd3c7b6081742eabc1364ed1db to your computer and use it in GitHub Desktop.
Save bouroo/12986edd3c7b6081742eabc1364ed1db to your computer and use it in GitHub Desktop.
php-5.6 on plesk
#!/usr/bin/env bash
#==============================================================================
# title: php56.sh
# description: This script automatically installs PHP 5.6 on Plesk RHEL
# author: Kawin Viriyaprasopsook <kawin.v@kkumail.com>
# usage: bash php56.sh
# notes: need `gcc libxml2-devel` packages
#==============================================================================
dnf -y install gcc libxml2-devel
wget https://www.php.net/distributions/php-5.6.40.tar.gz
tar -xf php-5.6.40.tar.gz
cd php-5.6.40
./configure \
--prefix /usr/local/php56 \
--with-config-file-path=/usr/local/lib/php56.ini \
--enable-fpm \
--with-fpm-group=www-data \
--enable-mbstring \
--enable-opcache \
--enable-zip
make && make install
cp php.ini-production /usr/local/lib/php56.ini
plesk bin php_handler --add -displayname 5.6.40-custom -path /usr/local/php56/bin/php-cgi -clipath /usr/local/php56/bin/php -phpini /usr/local/lib/php56.ini -type fastcgi -id custom-php56-fastcgi
# plesk bin php_handler --add -displayname 5.6.40-custom -path /usr/local/php56/sbin/php-fpm -phpini /usr/local/lib/php56.ini -type fpm -id custom-php56-fpm -clipath /usr/local/php56/bin/php -service <PHP FPM service name> -poold <path to php-fpm.d pool folder>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment