update APCu version 5.1.18
Shell-Script
- #!/bin/bash
- phpVersions='7.4 7.3 7.2 7.1 7.0 5.6'
- ### Do not change anything below this line
- echo 'List of PHP versions:' $phpVersions
- function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
- echo 'Adding Extensions'
- echo "Adding APCU"
- # See https://pecl.php.net/package/APCu for versions
- # version 4 for pre 7.0
- # version 5 for 7.0, 7.1, 7.2, 7.3, 7.4
- for version in $phpVersions
- do
- echo "Adding APCU to PHP version " $version
- if version_lt $version 7.0; then
- /opt/phpswitcher/static/php$version/bin/pecl install channel://pecl.php.net/apcu-4.0.11
- PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- echo "extension = $PHP_EXT_DIR/apcu.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/02_apcu.ini
- else
- /opt/phpswitcher/static/php$version/bin/pecl install channel://pecl.php.net/apcu-5.1.18
- PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- echo "extension = $PHP_EXT_DIR/apcu.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/02_apcu.ini
- fi
- done
- echo "Adding Imagick"
- aptitude install libmagickwand-dev imagick
- for version in $phpVersions
- do
- echo "Adding Imagick to PHP version " $version
- /opt/phpswitcher/static/php$version/bin/pecl install imagick
- PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- echo "extension = $PHP_EXT_DIR/imagick.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/03_imagick.ini
- done
- echo "Adding ioncube"
- cd /usr/local/src
- # cleanup first
- rm /usr/local/src/ioncube_loaders_lin_x86-64.tar.gz
- rm -r /usr/local/src/ioncube/
- wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
- tar -xzf ioncube_loaders_lin_x86-64.tar.gz
- rm ioncube_loaders_lin_x86-64.tar.gz
- cd ioncube
- for version in $phpVersions
- do
- echo "Adding Ioncube to PHP version" $version
- PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- cp ioncube_loader_lin_$version.so $PHP_EXT_DIR/ioncube.so
- echo "zend_extension = $PHP_EXT_DIR/ioncube.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/01_ioncube.ini
- done
- cd
- echo "Restarting services..."
- for version in $phpVersions
- do
- service psw$version-fpm restart
- done
- service apache2 restart
- service nginx restart
- echo "Done"