Thx Speddy for the info! I switched 7.4 to normal mode but left the code if there is going to be another beta version. I also tried to compile 7.4.8 but it seems that this is not working. Mayber someone has a solution for that (part of the error message: --override-config is not set; not updating apt.conf Read the manpage for details.).
Here is the new code:
Shell-Script
- #!/bin/bash
- #phpVersions='7.4 7.3 7.2 7.1 7.0 5.6'
- phpVersions='5.6 7.1 7.2 7.3 7.4'
- installDir=$(date +'%Y%m%d_%H%M%S')
- ### 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 'Compiling PHP versions'
- #perl /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/php_compiler.pl --install-dir $installDir --register $phpVersions
- perl /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/php_compiler.pl --register $phpVersions
- 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
- printf '\n' | /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
- printf '\n' | /opt/phpswitcher/static/php$version/bin/pecl install apcu
- 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
- printf '\n' | /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 Mcrypt"
- aptitude install libmcrypt-dev libc-dev autoconf pkg-config
- for version in $phpVersions
- do
- if version_lt $version 7.2; then
- echo "Ignoring version $version for Mcrypt (to low)"
- else
- echo "Adding Mcrypt to PHP version " $version
- printf '\n' | /opt/phpswitcher/static/php$version/bin/pecl install mcrypt
- PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- echo "extension = $PHP_EXT_DIR/mcrypt.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/03_mcrypt.ini
- fi
- done
- #echo "Adding additional extensions"
- #for version in $phpVersions
- #do
- # PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- # echo "extension = $PHP_EXT_DIR/mysqli.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/04_mysqli.ini
- # echo "extension = $PHP_EXT_DIR/opcache.so" > /opt/phpswitcher/static/php$version/etc/php/conf.d/04_opcache.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/
- # loading 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
- # --- 7.4 is no longer in a special beta archive ---
- # --- (codes stays in cases of another beta iconcube loader ---
- # loading BETA ioncube (has no ioncube subfolder)
- #wget https://www.ioncube.com/php-7.4.0-beta-loaders/ioncube_loaders_lin_x86-64_7.4_BETA2.tar.gz
- #tar -xzf ioncube_loaders_lin_x86-64_7.4_BETA2.tar.gz
- #rm ioncube_loaders_lin_x86-64_7.4_BETA2.tar.gz
- 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
- # --- Code if there is a beta version
- # if version_lt $version 7.4; then
- # 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
- # else
- # echo "Adding BETA Ioncube to PHP version" $version
- # PHP_EXT_DIR=$(/opt/phpswitcher/static/php$version/bin/php-config --extension-dir)
- # cp ioncube_loader_lin_7.4_10.4.0_beta2.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
- # fi
- done
- cd
- echo "Restarting services..."
- for version in $phpVersions
- do
- service psw$version-fpm restart
- done
- service apache2 restart
- service nginx restart
- echo "Done"
PHP 7.4.8 Error message - mayber someone can fix it:
Code
- Applying patch 0029-php-5.4.9-fixheader.patch
- patching file configure.ac
- Hunk #1 FAILED at 1303.
- 1 out of 1 hunk FAILED -- rejects in file configure.ac
- Patch 0029-php-5.4.9-fixheader.patch does not apply (enforce with -f)
- /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler/Makefile:230: recipe for target 'patch-stamp' failed
- make: Leaving directory '/usr/local/src/phpswitcher/php-7.4.8'
- I: Copying back the cached apt archive contents
- I: unmounting /var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler filesystem
- I: unmounting /usr/local/src/phpswitcher/php-7.4.8 filesystem
- I: unmounting /opt/phpswitcher/20200717 filesystem
- I: unmounting dev/ptmx filesystem
- I: unmounting dev/pts filesystem
- I: unmounting dev/shm filesystem
- I: unmounting proc filesystem
- I: unmounting sys filesystem
- I: Cleaning COW directory
- I: forking: rm -rf /var/cache/pbuilder/build/cow.23739
- [ERROR] main: An error occurred while executing MAKE(1) target(s) for PHP 7.4.8: W: --override-config is not set; not updating apt.conf Read the manpage for details.
- gpg: key 4F4EA0AAE5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Sur?" imported