1
0
Fork 0
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:
anmol26s 2018-06-30 16:43:30 +05:30
parent d33426529f
commit c3721fc52a
9 changed files with 28 additions and 27 deletions

View file

@ -8,7 +8,7 @@ index index.php index.htm index.html;
}
location ~ \.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;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;

View file

@ -30,7 +30,7 @@ group = __USER__
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; 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.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)

View file

@ -20,7 +20,7 @@
"multi_instance": true,
"services": [
"nginx",
"php7.1-fpm",
"php7.2-fpm",
"mysql"
],
"arguments": {

View file

@ -16,10 +16,10 @@ ynh_delete_file_checksum () {
# Create a dedicated php-fpm config
#
# usage: ynh_add_fpm_config
ynh_add_fpm7.1_config () {
# Configure PHP-FPM 7.1 by default
local fpm_config_dir="/etc/php/7.1/fpm"
local fpm_service="php7.1-fpm"
ynh_add_fpm7.2_config () {
# Configure PHP-FPM 7.2 by default
local fpm_config_dir="/etc/php/7.2/fpm"
local fpm_service="php7.2-fpm"
ynh_app_setting_set $app fpm_config_dir "$fpm_config_dir"
ynh_app_setting_set $app fpm_service "$fpm_service"
finalphpconf="$fpm_config_dir/pool.d/$app.conf"
@ -44,8 +44,8 @@ ynh_add_fpm7.1_config () {
# Remove the dedicated php-fpm config
#
# usage: ynh_remove_fpm7.1_config
ynh_remove_fpm7.1_config () {
# usage: ynh_remove_fpm7.2_config
ynh_remove_fpm7.2_config () {
local fpm_config_dir=$(ynh_app_setting_get $app fpm_config_dir)
local fpm_service=$(ynh_app_setting_get $app fpm_service)
ynh_secure_remove "$fpm_config_dir/pool.d/$app.conf"
@ -78,7 +78,7 @@ exec_composer() {
shift 1
COMPOSER_HOME="${WORKDIR}/.composer" \
sudo /usr/bin/php7.1 "${WORKDIR}/composer.phar" $@ \
sudo /usr/bin/php7.2 "${WORKDIR}/composer.phar" $@ \
-d "${WORKDIR}"
}
@ -91,7 +91,7 @@ init_composer() {
# install composer
curl -sS https://getcomposer.org/installer \
| 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"
# update dependencies to create composer.lock
@ -104,7 +104,7 @@ sudo_path () {
}
#
# PHP7.1 helpers
# php7.2 helpers
#
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
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
}
@ -124,5 +125,5 @@ ynh_remove_php7 () {
sudo rm -f /etc/apt/sources.list.d/php7.list
sudo apt-key del 4096R/89DF5277
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
}

View file

@ -49,8 +49,8 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup "/etc/php/7.1/fpm/pool.d/$app.conf"
ynh_backup "/etc/php/7.1/fpm/conf.d/20-$app.ini"
ynh_backup "/etc/php/7.2/fpm/pool.d/$app.conf"
ynh_backup "/etc/php/7.2/fpm/conf.d/20-$app.ini"
#=================================================
# BACKUP THE MYSQL DATABASE

View file

@ -110,11 +110,11 @@ ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_system_user_create $app
#=================================================
# PHP-FPM 7.1 CONFIGURATION
# PHP-FPM 7.2 CONFIGURATION
#=================================================
# Create a dedicated php-fpm7.1 config
ynh_add_fpm7.1_config
# Create a dedicated php-fpm7.2 config
ynh_add_fpm7.2_config
#=================================================
# SPECIFIC SETUP
@ -171,7 +171,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
systemctl reload php7.1-fpm
systemctl reload php7.2-fpm
systemctl reload nginx
# Set default php to php5 or php7.0
if [ "$(lsb_release --codename --short)" == "jessie" ]; then

View file

@ -48,7 +48,7 @@ ynh_remove_nginx_config
#=================================================
# Remove the dedicated php-fpm config
ynh_remove_fpm7.1_config
ynh_remove_fpm7.2_config
#=================================================
# GENERIC FINALIZATION

View file

@ -88,8 +88,8 @@ chown -R $app: $final_path
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_restore_file "/etc/php/7.1/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/pool.d/$app.conf"
ynh_restore_file "/etc/php/7.2/fpm/conf.d/20-$app.ini"
#=================================================
# SPECIFIC RESTORATION
@ -103,7 +103,7 @@ ynh_restore_file "/etc/php/7.1/fpm/conf.d/20-$app.ini"
# RELOAD NGINX AND PHP-FPM
#=================================================
systemctl reload php7.1-fpm
systemctl reload php7.2-fpm
systemctl reload nginx
# Set default php to php5 or php7.0
if [ "$(lsb_release --codename --short)" == "jessie" ]; then

View file

@ -103,11 +103,11 @@ ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_system_user_create $app
#=================================================
# PHP-FPM 7.1 CONFIGURATION
# PHP-FPM 7.2 CONFIGURATION
#=================================================
# Create a dedicated php-fpm7.1 config
ynh_add_fpm7.1_config
ynh_add_fpm7.2_config
#=================================================
@ -148,7 +148,7 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
systemctl reload php7.1-fpm
systemctl reload php7.2-fpm
systemctl reload nginx
# Set default php to php5 or php7.0
if [ "$(lsb_release --codename --short)" == "jessie" ]; then