1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpinfo_ynh.git synced 2024-09-03 19:56:23 +02:00

Fix php-fpm service

This commit is contained in:
yalh76 2021-03-11 02:46:52 +01:00
parent 2b1d498b70
commit f79df83a81
3 changed files with 20 additions and 12 deletions

View file

@ -55,6 +55,7 @@ ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
ynh_install_php --php_version=$php_version
YNH_PHP_VERSION=$(ynh_app_setting_get --app=$app --key=php_version)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -59,14 +59,6 @@ then
cp -f ../sources/index.php /$final_path/.
fi
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@ -74,6 +66,15 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
ynh_install_php --php_version=$php_version
YNH_PHP_VERSION=$(ynh_app_setting_get --app=$app --key=php_version)
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER

View file

@ -196,17 +196,17 @@ ynh_install_php () {
ynh_app_setting_set --app=$YNH_APP_INSTANCE_NAME --key=php_version --value=$final_php_version
# Remove app virtualenv
if `phpenv alias --list | grep --quiet "$YNH_APP_INSTANCE_NAME" 1>/dev/null 2>&1`
if `phpenv alias --list | grep --quiet "$YNH_APP_INSTANCE_NAME " 1>/dev/null 2>&1`
then
phpenv alias $YNH_APP_INSTANCE_NAME --remove
fi
# Create app virtualenv
phpenv alias $YNH_APP_INSTANCE_NAME $final_php_version
# Cleanup PHP versions
ynh_cleanup_php
# Create app virtualenv
# phpenv alias $YNH_APP_INSTANCE_NAME $final_php_version
# Install php-fpm service
cp -f "$php_version_path/$final_php_version/etc/systemd/system/php-fpm.service" "/etc/systemd/system/php$final_php_version-fpm.service"
systemctl enable php$final_php_version-fpm --quiet
@ -238,6 +238,8 @@ ynh_remove_php () {
# Remove /usr/local/bin in PATH in case of PHP prior installation
PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@')
phpenv alias $YNH_APP_INSTANCE_NAME --remove
# Remove the line for this app
ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=php_version
@ -293,11 +295,15 @@ ynh_cleanup_php () {
ynh_add_fpm_config () {
php_version=$(ynh_app_setting_get --app=$app --key=php_version)
ynh_use_php
ynh_add_config --template="../conf/php-fpm.conf" --destination="$ynh_fpm_conf"
systemctl reload-or-restart php$php_version-fpm
}
ynh_remove_fpm_config () {
php_version=$(ynh_app_setting_get --app=$app --key=php_version)
ynh_use_php
ynh_secure_remove --file="$ynh_fpm_conf"
systemctl reload-or-restart php$php_version-fpm
}