Skip to content

Commit

Permalink
Fix PHP install
Browse files Browse the repository at this point in the history
  • Loading branch information
joglomedia committed Aug 4, 2024
1 parent b1a709a commit 3f511da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
sed -i "s/FORCE_REMOVE=false/FORCE_REMOVE=true/g" .env
sed -i "s/LEMPER_ADMIN_EMAIL=\"[email protected]\"/LEMPER_ADMIN_EMAIL=\"[email protected]\"/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
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
sed -i "s/FORCE_REMOVE=false/FORCE_REMOVE=true/g" .env
sed -i "s/LEMPER_ADMIN_EMAIL=\"[email protected]\"/LEMPER_ADMIN_EMAIL=\"[email protected]\"/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
Expand Down
22 changes: 11 additions & 11 deletions scripts/install_php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

0 comments on commit 3f511da

Please sign in to comment.