1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

upgrade to php7.3

This commit is contained in:
yalh76 2019-07-19 07:06:48 +02:00
parent 327eb50cf3
commit f78581dfab
10 changed files with 48 additions and 48 deletions

View file

@ -27,7 +27,7 @@ After being first registered, you need to execute the folloing command to promot
**Run:** **Run:**
$ (cd /var/www/pixelfed && php7.2 artisan user:admin 1) $ (cd /var/www/pixelfed && php7.3 artisan user:admin 1)
and respond yes to the question ` Add admin privileges to this user?` and respond yes to the question ` Add admin privileges to this user?`
@ -35,12 +35,12 @@ and respond yes to the question ` Add admin privileges to this user?`
Registrations are open by default. Registrations are open by default.
To change that setting, edit `/var/www/pixelfed/.env` and set `OPEN_REGISTRATION=false` instead of `true`. To change that setting, edit `/var/www/pixelfed/.env` and set `OPEN_REGISTRATION=false` instead of `true`.
Then run `php7.2 artisan config:cache` to reload the settings. Then run `php7.3 artisan config:cache` to reload the settings.
### Pixelfed php commands and php version ### Pixelfed php commands and php version
Pixelfed might require some command line instructions if you want to make manual changes to your configuration. Pixelfed might require some command line instructions if you want to make manual changes to your configuration.
By default php 7.0 is currently used when you type `php`. You need to use `php7.2 [command]` instead. By default php 7.0 is currently used when you type `php`. You need to use `php7.3 [command]` instead.
Those commands can be found in the official documentation. Those commands can be found in the official documentation.
## Documentation ## Documentation

View file

@ -7,7 +7,7 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__/ WorkingDirectory=__FINALPATH__/
ExecStart=/usr/bin/php7.2 __FINALPATH__/artisan horizon ExecStart=/usr/bin/php7.3 __FINALPATH__/artisan horizon
Restart=on-failure Restart=on-failure
[Install] [Install]

View file

@ -16,7 +16,7 @@ location __PATH__/ {
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.3-fpm-__NAME__.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;

View file

@ -33,7 +33,7 @@ group = __USER__
; (IPv6 and IPv4-mapped) on a specific port; ; (IPv6 and IPv4-mapped) on a 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/php/php7.2-fpm-__NAMETOCHANGE__.sock listen = /var/run/php/php7.3-fpm-__NAMETOCHANGE__.sock
; Set listen(2) backlog. ; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD) ; Default Value: 511 (-1 on FreeBSD and OpenBSD)

View file

@ -9,7 +9,7 @@ pkg_dependencies="postgresql redis-server \
libfreetype6 libjpeg62-turbo libpng16-16 libxpm4 libvpx4 libmagickwand-6.q16-3 libwebp6 \ libfreetype6 libjpeg62-turbo libpng16-16 libxpm4 libvpx4 libmagickwand-6.q16-3 libwebp6 \
pngquant jpegoptim gifsicle" pngquant jpegoptim gifsicle"
extra_pkg_dependencies="php7.2-bcmath php7.2-cli php7.2-curl php7.2-exif php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-pgsql php7.2-simplexml php7.2-xml php7.2-zip" extra_pkg_dependencies="php7.3-bcmath php7.3-cli php7.3-curl php7.3-exif php7.3-gd php7.3-intl php7.3-json php7.3-mbstring php7.3-pgsql php7.3-simplexml php7.3-xml php7.3-zip"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
@ -68,7 +68,7 @@ ynh_install_composer () {
# Install another version of php. # Install another version of php.
# #
# usage: ynh_install_php --phpversion=phpversion [--package=packages] # usage: ynh_install_php --phpversion=phpversion [--package=packages]
# | arg: -v, --phpversion - Version of php to install. Can be one of 7.1, 7.2 or 7.3 # | arg: -v, --phpversion - Version of php to install. Can be one of 7.1, 7.3 or 7.3
# | arg: -p, --package - Additionnal php packages to install # | arg: -p, --package - Additionnal php packages to install
ynh_install_php () { ynh_install_php () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.

View file

@ -56,7 +56,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
ynh_print_info --message="Backing up php-fpm configuration..." ynh_print_info --message="Backing up php-fpm configuration..."
ynh_backup --src_path="/etc/php/7.2/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/7.3/fpm/pool.d/$app.conf"
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE

View file

@ -88,11 +88,11 @@ ynh_store_file_checksum --file="$config"
#================================================= #=================================================
pushd "$final_path" pushd "$final_path"
php7.2 artisan config:clear php7.3 artisan config:clear
php7.2 artisan config:cache php7.3 artisan config:cache
php7.2 artisan route:clear php7.3 artisan route:clear
php7.2 artisan route:cache php7.3 artisan route:cache
php7.2 artisan horizon:purge php7.3 artisan horizon:purge
popd popd
#================================================= #=================================================

View file

@ -62,7 +62,7 @@ ynh_install_app_dependencies "$pkg_dependencies"
#================================================= #=================================================
ynh_print_info --message="Installing php..." ynh_print_info --message="Installing php..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# CREATE A POSTGRESQL DATABASE # CREATE A POSTGRESQL DATABASE
@ -110,7 +110,7 @@ ynh_system_user_create --username="$app"
ynh_print_info --message="Configuring php-fpm..." ynh_print_info --message="Configuring php-fpm..."
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config --phpversion="7.2" ynh_add_fpm_config --phpversion="7.3"
#================================================= #=================================================
# INSTALL PHP DEPENDENCIES # INSTALL PHP DEPENDENCIES
@ -118,12 +118,12 @@ ynh_add_fpm_config --phpversion="7.2"
chown -R "$app": "$final_path" chown -R "$app": "$final_path"
ynh_install_composer --phpversion="7.2" --workdir="$final_path" ynh_install_composer --phpversion="7.3" --workdir="$final_path"
# Fix Google Recaptcha removal # Fix Google Recaptcha removal
ynh_secure_remove --file="$final_path/bootstrap/cache" ynh_secure_remove --file="$final_path/bootstrap/cache"
mkdir -p "$final_path/bootstrap/cache" mkdir -p "$final_path/bootstrap/cache"
ynh_composer_exec --phpversion="7.2" --workdir="$final_path" --commands="dump-autoload" ynh_composer_exec --phpversion="7.3" --workdir="$final_path" --commands="dump-autoload"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
@ -162,17 +162,17 @@ ynh_store_file_checksum --file="$config"
#================================================= #=================================================
pushd "$final_path" pushd "$final_path"
php7.2 artisan -n key:generate --force php7.3 artisan -n key:generate --force
php7.2 artisan horizon:install php7.3 artisan horizon:install
php7.2 artisan config:clear php7.3 artisan config:clear
php7.2 artisan config:cache php7.3 artisan config:cache
php7.2 artisan route:cache php7.3 artisan route:cache
php7.2 artisan view:cache php7.3 artisan view:cache
php7.2 artisan storage:link php7.3 artisan storage:link
php7.2 artisan migrate --force php7.3 artisan migrate --force
php7.2 artisan update php7.3 artisan update
php7.2 artisan horizon:purge php7.3 artisan horizon:purge
php7.2 artisan horizon:assets php7.3 artisan horizon:assets
popd popd
#================================================= #=================================================

View file

@ -76,13 +76,13 @@ chown -R "$app": "$final_path"
#================================================= #=================================================
ynh_print_info --message="Installing php..." ynh_print_info --message="Installing php..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/7.3/fpm/pool.d/$app.conf"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -131,7 +131,7 @@ ynh_systemd_action --service_name="${app}-horizon" --action="start" --log_path=s
#================================================= #=================================================
ynh_print_info --message="Reloading nginx web server and php-fpm..." ynh_print_info --message="Reloading nginx web server and php-fpm..."
ynh_systemd_action --service_name=php7.2-fpm --action=reload ynh_systemd_action --service_name=php7.3-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -124,7 +124,7 @@ ynh_install_app_dependencies "$pkg_dependencies"
#================================================= #=================================================
ynh_print_info --message="Upgrading php..." ynh_print_info --message="Upgrading php..."
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -140,7 +140,7 @@ ynh_system_user_create --username="$app"
ynh_print_info --message="Upgrading php-fpm configuration..." ynh_print_info --message="Upgrading php-fpm configuration..."
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config --phpversion="7.2" ynh_add_fpm_config --phpversion="7.3"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -153,9 +153,9 @@ chown -R "$app": "$final_path"
# Fix Google Recaptcha removal # Fix Google Recaptcha removal
ynh_secure_remove --file="$final_path/bootstrap/cache" ynh_secure_remove --file="$final_path/bootstrap/cache"
mkdir -p "$final_path/bootstrap/cache" mkdir -p "$final_path/bootstrap/cache"
ynh_composer_exec --phpversion="7.2" --workdir="$final_path" --commands="dump-autoload" ynh_composer_exec --phpversion="7.3" --workdir="$final_path" --commands="dump-autoload"
ynh_composer_exec --phpversion="7.2" --workdir="$final_path" --commands="update" ynh_composer_exec --phpversion="7.3" --workdir="$final_path" --commands="update"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -181,18 +181,18 @@ ynh_store_file_checksum --file="$config"
#================================================= #=================================================
pushd "$final_path" pushd "$final_path"
php7.2 artisan horizon:install php7.3 artisan horizon:install
php7.2 artisan config:clear php7.3 artisan config:clear
php7.2 artisan config:cache php7.3 artisan config:cache
php7.2 artisan route:clear php7.3 artisan route:clear
php7.2 artisan route:cache php7.3 artisan route:cache
php7.2 artisan view:clear php7.3 artisan view:clear
php7.2 artisan view:cache php7.3 artisan view:cache
php7.2 artisan storage:link php7.3 artisan storage:link
php7.2 artisan migrate --force php7.3 artisan migrate --force
php7.2 artisan update php7.3 artisan update
php7.2 artisan horizon:purge php7.3 artisan horizon:purge
php7.2 artisan horizon:assets php7.3 artisan horizon:assets
popd popd
#================================================= #=================================================