diff --git a/scripts/install b/scripts/install index f1fd957..d7284f3 100644 --- a/scripts/install +++ b/scripts/install @@ -93,6 +93,13 @@ ynh_print_info --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app --home_dir="$final_path" +#================================================= +# INSTALL PHP 7.2 +#================================================= +ynh_print_info --message="Installing PHP 7.2..." + +ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" + #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -111,14 +118,6 @@ ynh_print_info --message="Creating final path..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path mkdir -p "$final_path" -#================================================= -# INSTALL PHP 7.2 -#================================================= -ynh_print_info --message="Installing PHP 7.2..." - -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" -ynh_systemd_action --service_name=php7.2-fpm --action=reload - #================================================= # CREATE DRUSH ALIAS #================================================= diff --git a/scripts/restore b/scripts/restore index cd75cea..e52faa5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,6 +72,13 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # Restore permissions on app files chown -R $app: $final_path +#================================================= +# REINSTALL PHP +#================================================= +ynh_print_info --message="Reinstalling php..." + +ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -103,14 +110,6 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ ynh_restore_file --origin_path="/etc/cron.d/$app" -#================================================= -# REINSTALL PHP -#================================================= -ynh_print_info --message="Reinstalling php..." - -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" -ynh_systemd_action --service_name=php7.2-fpm --action=reload - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ff0ea97..3dceb2d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,6 +98,13 @@ ynh_print_info --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" +#================================================= +# UPDATE PHP +#================================================= +ynh_print_info --message="Updating PHP..." + +ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" + #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -108,14 +115,6 @@ ynh_add_fpm_config --phpversion="7.2" #================================================= # SPECIFIC UPGRADE -#================================================= -# UPDATE PHP -#================================================= -ynh_print_info --message="Updating PHP..." - -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" -ynh_systemd_action --service_name=php7.2-fpm --action=reload - #================================================= # UPDATE COMPOSER #=================================================