Skip to content

Instantly share code, notes, and snippets.

@lesstif
Last active March 8, 2021 07:38
Show Gist options
  • Save lesstif/ce352e866ab9a4fd03a6c64aed1e8bb9 to your computer and use it in GitHub Desktop.
Save lesstif/ce352e866ab9a4fd03a6c64aed1e8bb9 to your computer and use it in GitHub Desktop.
install php package from remi repository
#!/bin/bash
VERS="70 71 72 73 74 80"
PKGS="php72 php72-php-bcmath php72-php-cli php72-php-common php72-php-gd \
php72-php-gmp php72-php-intl php72-php-json php72-php-mbstring \
php72-php-mysqlnd php72-php-pdo php72-php-sodium \
php72-php-xml php72-runtime php72-php-fpm php72-php-process \
php72-php-pecl-igbinary php72-php-pecl-redis5 php72-php-pecl-zip "
for v in ${VERS};do
echo "installing PHP $v";
P="${PKGS//72/${v}}"
# echo ${P}
yum install ${P} -y
ln -sf /opt/remi/php${v}/root/usr/bin/php /usr/local/bin/php${v}
ln -sf /opt/remi/php${v}/root/usr/bin/phpize /usr/local/bin/phpize${v}
ln -sf /opt/remi/php${v}/root/usr/bin/phar /usr/local/bin/phar${v}
ln -sf /opt/remi/php${v}/root/usr/sbin/php-fpm /usr/local/sbin/php-fpm${v}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment