From 3f511da8fc18832c8d66533655a82bfd6732c657 Mon Sep 17 00:00:00 2001 From: Edi Septriyanto Date: Sun, 4 Aug 2024 23:30:14 +0700 Subject: [PATCH] Fix PHP install --- .github/workflows/main.yml | 4 ++-- scripts/install_php.sh | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cbdf04..c03360d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: sed -i "s/FORCE_REMOVE=false/FORCE_REMOVE=true/g" .env sed -i "s/LEMPER_ADMIN_EMAIL=\"mail@example.com\"/LEMPER_ADMIN_EMAIL=\"me@masedi.net\"/g" .env sed -i "s/NGINX_INSTALLER=\"source\"/NGINX_INSTALLER=\"repo\"/g" .env - sed -i "s/NGX_PAGESPEED=false/NGINX_INSTALLER=true/g" .env + # sed -i "s/NGX_PAGESPEED=false/NGX_PAGESPEED=true/g" .env sed -i "s/INSTALL_PHP_LOADER=false/INSTALL_PHP_LOADER=true/g" .env sed -i "s/PHP_LOADER=\"none\"/PHP_LOADER=\"ioncube\"/g" .env sed -i "s/IMAGEMAGICK_INSTALLER=\"source\"/IMAGEMAGICK_INSTALLER=\"repo\"/g" .env @@ -94,7 +94,7 @@ jobs: sed -i "s/FORCE_REMOVE=false/FORCE_REMOVE=true/g" .env sed -i "s/LEMPER_ADMIN_EMAIL=\"mail@example.com\"/LEMPER_ADMIN_EMAIL=\"me@masedi.net\"/g" .env sed -i "s/NGINX_INSTALLER=\"source\"/NGINX_INSTALLER=\"repo\"/g" .env - sed -i "s/NGX_PAGESPEED=false/NGINX_INSTALLER=true/g" .env + # sed -i "s/NGX_PAGESPEED=false/NGX_PAGESPEED=true/g" .env sed -i "s/INSTALL_PHP_LOADER=false/INSTALL_PHP_LOADER=true/g" .env sed -i "s/PHP_LOADER=\"none\"/PHP_LOADER=\"ioncube\"/g" .env sed -i "s/IMAGEMAGICK_INSTALLER=\"source\"/IMAGEMAGICK_INSTALLER=\"repo\"/g" .env diff --git a/scripts/install_php.sh b/scripts/install_php.sh index 9606565..ec4b9b7 100755 --- a/scripts/install_php.sh +++ b/scripts/install_php.sh @@ -1092,17 +1092,6 @@ function init_php_install() { install_php "${DEFAULT_PHP_VERSION}" install_php_loader "${DEFAULT_PHP_VERSION}" "${OPT_PHP_LOADER}" restart_php_fpm "${DEFAULT_PHP_VERSION}" - - # Set default PHP. - if [[ -n $(command -v "php${DEFAULT_PHP_VERSION}") ]]; then - echo "Set default PHP command line to version ${DEFAULT_PHP_VERSION}..." - - run update-alternatives --set php "$(command -v "php${DEFAULT_PHP_VERSION}")" - run update-alternatives --set phar "$(command -v "phar${DEFAULT_PHP_VERSION}")" - run update-alternatives --set phar.phar "$(command -v "phar.phar${DEFAULT_PHP_VERSION}")" - run update-alternatives --set php-config "$(command -v "php-config${DEFAULT_PHP_VERSION}")" - run update-alternatives --set phpize "$(command -v "phpize${DEFAULT_PHP_VERSION}")" - fi fi # Install PHP composer. @@ -1114,3 +1103,14 @@ echo "[PHP & Extensions Installation]" # Start running things from a call at the end so if this script is executed # after a partial download it doesn't do anything. init_php_install "$@" + +# Set default PHP. +if [[ -n $(command -v "php${DEFAULT_PHP_VERSION}") ]]; then + echo "Set default PHP command line to version ${DEFAULT_PHP_VERSION}..." + + run update-alternatives --set php "$(command -v "php${DEFAULT_PHP_VERSION}")" + run update-alternatives --set phar "$(command -v "phar${DEFAULT_PHP_VERSION}")" + run update-alternatives --set phar.phar "$(command -v "phar.phar${DEFAULT_PHP_VERSION}")" + run update-alternatives --set php-config "$(command -v "php-config${DEFAULT_PHP_VERSION}")" + run update-alternatives --set phpize "$(command -v "phpize${DEFAULT_PHP_VERSION}")" +fi