From 9b184441ebaa234e4d0e7e784ce231d7cf67de7c Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 25 May 2022 09:46:54 +0200 Subject: [PATCH] Specify PHP version in every calls (#132) * Specify PHP version in every calls * Switch (back) to php7.4 * Add PHP-xml dependency for DOM extension Co-authored-by: lapineige --- scripts/_common.sh | 4 +++- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 1bf1664..c4d085e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,10 @@ # COMMON VARIABLES #================================================= +phpversion="7.4" + # dependencies used by the app -pkg_dependencies="php$YNH_DEFAULT_PHP_VERSION-cli php$YNH_DEFAULT_PHP_VERSION-mysql php$YNH_DEFAULT_PHP_VERSION-json php$YNH_DEFAULT_PHP_VERSION-gd php$YNH_DEFAULT_PHP_VERSION-tidy php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-php-gettext php$YNH_DEFAULT_PHP_VERSION-redis" +pkg_dependencies="php$phpversion-cli php$phpversion-mysql php$phpversion-json php$phpversion-gd php$phpversion-tidy php$phpversion-curl php-gettext php$phpversion-redis php$phpversion-xml" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 980e7fa..34f0e6c 100644 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$phpversion #================================================= # SPECIFIC SETUP @@ -121,7 +121,7 @@ ynh_replace_string --match_string="secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" --rep ynh_replace_string --match_string="domain_name: https://your-wallabag-url-instance.com" --replace_string="domain_name: https://$domain$path_url" --target_file=$wb_conf # Alias for php-cli execution command -php_exec="ynh_exec_as $app php "$final_path/bin/console" --no-interaction --env=prod" +php_exec="ynh_exec_as $app php$phpversion "$final_path/bin/console" --no-interaction --env=prod" # Set permissions to app files chown -R $app: $final_path diff --git a/scripts/upgrade b/scripts/upgrade index d9a1138..c1be929 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,7 +123,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$phpversion # Set-up fail2ban # Create the log file is not already existing @@ -164,7 +164,7 @@ then #================================================= # Alias for php-cli execution command - php_exec="ynh_exec_as $app php "$final_path/bin/console" --no-interaction --env=prod" + php_exec="ynh_exec_as $app php$phpversion "$final_path/bin/console" --no-interaction --env=prod" # Set permissions to app files chown -R $app: $final_path