mirror of
https://github.com/YunoHost-Apps/kimai2_ynh.git
synced 2024-09-03 19:26:26 +02:00
install php7.2
This commit is contained in:
parent
d33426529f
commit
c3721fc52a
9 changed files with 28 additions and 27 deletions
|
@ -8,7 +8,7 @@ index index.php index.htm index.html;
|
||||||
}
|
}
|
||||||
location ~ \.php {
|
location ~ \.php {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
fastcgi_pass unix:/var/run/php7.1-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php7.2-fpm-__NAME__.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param REMOTE_USER $remote_user;
|
fastcgi_param REMOTE_USER $remote_user;
|
||||||
|
|
|
@ -30,7 +30,7 @@ group = __USER__
|
||||||
; specific port;
|
; specific port;
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||||
; Note: This value is mandatory.
|
; Note: This value is mandatory.
|
||||||
listen = /var/run/php7.1-fpm-__NAMETOCHANGE__.sock
|
listen = /var/run/php7.2-fpm-__NAMETOCHANGE__.sock
|
||||||
|
|
||||||
; Set listen(2) backlog. A value of '-1' means unlimited.
|
; Set listen(2) backlog. A value of '-1' means unlimited.
|
||||||
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
|
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx",
|
"nginx",
|
||||||
"php7.1-fpm",
|
"php7.2-fpm",
|
||||||
"mysql"
|
"mysql"
|
||||||
],
|
],
|
||||||
"arguments": {
|
"arguments": {
|
||||||
|
|
|
@ -16,10 +16,10 @@ ynh_delete_file_checksum () {
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
#
|
#
|
||||||
# usage: ynh_add_fpm_config
|
# usage: ynh_add_fpm_config
|
||||||
ynh_add_fpm7.1_config () {
|
ynh_add_fpm7.2_config () {
|
||||||
# Configure PHP-FPM 7.1 by default
|
# Configure PHP-FPM 7.2 by default
|
||||||
local fpm_config_dir="/etc/php/7.1/fpm"
|
local fpm_config_dir="/etc/php/7.2/fpm"
|
||||||
local fpm_service="php7.1-fpm"
|
local fpm_service="php7.2-fpm"
|
||||||
ynh_app_setting_set $app fpm_config_dir "$fpm_config_dir"
|
ynh_app_setting_set $app fpm_config_dir "$fpm_config_dir"
|
||||||
ynh_app_setting_set $app fpm_service "$fpm_service"
|
ynh_app_setting_set $app fpm_service "$fpm_service"
|
||||||
finalphpconf="$fpm_config_dir/pool.d/$app.conf"
|
finalphpconf="$fpm_config_dir/pool.d/$app.conf"
|
||||||
|
@ -44,8 +44,8 @@ ynh_add_fpm7.1_config () {
|
||||||
|
|
||||||
# Remove the dedicated php-fpm config
|
# Remove the dedicated php-fpm config
|
||||||
#
|
#
|
||||||
# usage: ynh_remove_fpm7.1_config
|
# usage: ynh_remove_fpm7.2_config
|
||||||
ynh_remove_fpm7.1_config () {
|
ynh_remove_fpm7.2_config () {
|
||||||
local fpm_config_dir=$(ynh_app_setting_get $app fpm_config_dir)
|
local fpm_config_dir=$(ynh_app_setting_get $app fpm_config_dir)
|
||||||
local fpm_service=$(ynh_app_setting_get $app fpm_service)
|
local fpm_service=$(ynh_app_setting_get $app fpm_service)
|
||||||
ynh_secure_remove "$fpm_config_dir/pool.d/$app.conf"
|
ynh_secure_remove "$fpm_config_dir/pool.d/$app.conf"
|
||||||
|
@ -78,7 +78,7 @@ exec_composer() {
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
COMPOSER_HOME="${WORKDIR}/.composer" \
|
COMPOSER_HOME="${WORKDIR}/.composer" \
|
||||||
sudo /usr/bin/php7.1 "${WORKDIR}/composer.phar" $@ \
|
sudo /usr/bin/php7.2 "${WORKDIR}/composer.phar" $@ \
|
||||||
-d "${WORKDIR}"
|
-d "${WORKDIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ init_composer() {
|
||||||
# install composer
|
# install composer
|
||||||
curl -sS https://getcomposer.org/installer \
|
curl -sS https://getcomposer.org/installer \
|
||||||
| COMPOSER_HOME="${DESTDIR}/.composer" \
|
| COMPOSER_HOME="${DESTDIR}/.composer" \
|
||||||
sudo /usr/bin/php7.1 -- --install-dir="$DESTDIR" \
|
sudo /usr/bin/php7.2 -- --install-dir="$DESTDIR" \
|
||||||
|| ynh_die "Unable to install Composer"
|
|| ynh_die "Unable to install Composer"
|
||||||
|
|
||||||
# update dependencies to create composer.lock
|
# update dependencies to create composer.lock
|
||||||
|
@ -104,7 +104,7 @@ sudo_path () {
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# PHP7.1 helpers
|
# php7.2 helpers
|
||||||
#
|
#
|
||||||
|
|
||||||
ynh_install_php7 () {
|
ynh_install_php7 () {
|
||||||
|
@ -116,7 +116,8 @@ ynh_install_php7 () {
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list
|
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list
|
||||||
|
|
||||||
ynh_package_update
|
ynh_package_update
|
||||||
ynh_install_app_dependencies php7.1 php7.1-zip php7.1-fpm php7.1-mysql php7.1-xml php7.1-intl php7.1-mbstring php7.1-gd php7.1-curl php7.1-bcmath php7.1-opcache
|
ynh_install_app_dependencies php7.2 php7.2-zip php7.2-fpm php7.2-mysql php7.2-xml php7.2-intl php7.2-mbstring php7.2-gd php7.2-curl php7.2-bcmath php7.2-opcache php7.2-sqlite
|
||||||
|
|
||||||
sudo update-alternatives --install /usr/bin/php php /usr/bin/php5 70
|
sudo update-alternatives --install /usr/bin/php php /usr/bin/php5 70
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,5 +125,5 @@ ynh_remove_php7 () {
|
||||||
sudo rm -f /etc/apt/sources.list.d/php7.list
|
sudo rm -f /etc/apt/sources.list.d/php7.list
|
||||||
sudo apt-key del 4096R/89DF5277
|
sudo apt-key del 4096R/89DF5277
|
||||||
sudo apt-key del 2048R/11A06851
|
sudo apt-key del 2048R/11A06851
|
||||||
ynh_remove_app_dependencies php7.1 php7.1-zip php7.1-fpm php7.1-mysql php7.1-xml php7.1-intl php7.1-mbstring php7.1-gd php7.1-curl php7.1-bcmath php7.1-opcache
|
ynh_remove_app_dependencies php7.2 php7.2-zip php7.2-fpm php7.2-mysql php7.2-xml php7.2-intl php7.2-mbstring php7.2-gd php7.2-curl php7.2-bcmath php7.2-opcache php7.2-sqlite
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/etc/php/7.1/fpm/pool.d/$app.conf"
|
ynh_backup "/etc/php/7.2/fpm/pool.d/$app.conf"
|
||||||
ynh_backup "/etc/php/7.1/fpm/conf.d/20-$app.ini"
|
ynh_backup "/etc/php/7.2/fpm/conf.d/20-$app.ini"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE MYSQL DATABASE
|
||||||
|
|
|
@ -110,11 +110,11 @@ ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM 7.1 CONFIGURATION
|
# PHP-FPM 7.2 CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Create a dedicated php-fpm7.1 config
|
# Create a dedicated php-fpm7.2 config
|
||||||
ynh_add_fpm7.1_config
|
ynh_add_fpm7.2_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -171,7 +171,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
systemctl reload php7.1-fpm
|
systemctl reload php7.2-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
# Set default php to php5 or php7.0
|
# Set default php to php5 or php7.0
|
||||||
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
||||||
|
|
|
@ -48,7 +48,7 @@ ynh_remove_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove the dedicated php-fpm config
|
# Remove the dedicated php-fpm config
|
||||||
ynh_remove_fpm7.1_config
|
ynh_remove_fpm7.2_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -88,8 +88,8 @@ chown -R $app: $final_path
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_restore_file "/etc/php/7.1/fpm/pool.d/$app.conf"
|
ynh_restore_file "/etc/php/7.2/fpm/pool.d/$app.conf"
|
||||||
ynh_restore_file "/etc/php/7.1/fpm/conf.d/20-$app.ini"
|
ynh_restore_file "/etc/php/7.2/fpm/conf.d/20-$app.ini"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
@ -103,7 +103,7 @@ ynh_restore_file "/etc/php/7.1/fpm/conf.d/20-$app.ini"
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload php7.1-fpm
|
systemctl reload php7.2-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
# Set default php to php5 or php7.0
|
# Set default php to php5 or php7.0
|
||||||
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
||||||
|
|
|
@ -103,11 +103,11 @@ ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM 7.1 CONFIGURATION
|
# PHP-FPM 7.2 CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Create a dedicated php-fpm7.1 config
|
# Create a dedicated php-fpm7.1 config
|
||||||
ynh_add_fpm7.1_config
|
ynh_add_fpm7.2_config
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -148,7 +148,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
systemctl reload php7.1-fpm
|
systemctl reload php7.2-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
# Set default php to php5 or php7.0
|
# Set default php to php5 or php7.0
|
||||||
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue