... | ... | @@ -7,11 +7,14 @@ |
|
|
- This does not work for DietPi Docker. You can't upgrade PHP in a Docker image.
|
|
|
- _Make sure to make a backup of your entire DietPi Instance (config, data, etc.) before you do this._
|
|
|
|
|
|
|
|
|
|
|
|
## Log in as Root
|
|
|
If you're using SSH, log in with `ssh root@<your dietpi ip>`.
|
|
|
If you're directly on the device, use `sudo su`
|
|
|
|
|
|
|
|
|
|
|
|
## Add PHP Package Archive
|
|
|
Execute the following commands on your DietPi to add the repository PHP 8.0 from [deb.sury.org](https://deb.sury.org/#php-packages):
|
|
|
|
... | ... | @@ -24,6 +27,7 @@ apt-get update |
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Install PHP 8.0
|
|
|
Execute the following command on your DietPi to install PHP 8.0:
|
|
|
|
... | ... | @@ -32,14 +36,22 @@ Execute the following command on your DietPi to install PHP 8.0: |
|
|
apt-get -y install php8.0-fpm php8.0-apcu php8.0-mysql php8.0-xml php8.0-zip php8.0-mbstring php8.0-gd php8.0-curl php8.0-redis php8.0-intl php8.0-bcmath php8.0-gmp php8.0-imagick imagemagick
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Update the PHP 8.0 configuration
|
|
|
Execute the following command on your DietPi to link the DietPi configuration for PHP from PHP 7.3 to 8.0 and enable it:
|
|
|
```bash
|
|
|
# Enable the image magick module
|
|
|
phpenmod imagick
|
|
|
|
|
|
# Symlink NCP PHP configuration
|
|
|
ln -s /etc/php/7.3/mods-available/dietpi-nextcloud.ini /etc/php/8.0/mods-available/dietpi-nextcloud.ini
|
|
|
ln -s /etc/php/7.3/mods-available/dietpi.ini /etc/php/8.0/mods-available/dietpi.ini
|
|
|
phpenmod dietpi
|
|
|
phpenmod dietpi-nextcloud
|
|
|
|
|
|
# Restart PHP
|
|
|
service php8.0-fpm restart
|
|
|
```
|
|
|
|
|
|
Now you need to edit the configuration of PHP FPM.
|
... | ... | @@ -50,7 +62,8 @@ with `CRTL` + `o` you can save the changed file and |
|
|
with `CRTL` + `x` you can close the editor.
|
|
|
|
|
|
|
|
|
## Set up lighttpd for PHP 8.0
|
|
|
|
|
|
## Set up Lighttpd for PHP 8.0
|
|
|
Now you need to edit the configuration for lighttpd to instruct it to use PHP 8.0
|
|
|
Run `nano /etc/lighttpd/conf-available/15-fastcgi-php.conf` to open the configuration file.
|
|
|
|
... | ... | @@ -80,21 +93,31 @@ service lighttpd force-reload |
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Check for Nextcloud and App updates
|
|
|
```bash
|
|
|
# Check for updates
|
|
|
ncc update:check
|
|
|
|
|
|
# Install updates of the passwords app if available
|
|
|
ncc app:update passwords
|
|
|
```
|
|
|
|
|
|
|
|
|
## Check the PHP default version
|
|
|
By default, your DietPi should now be using PHP 8.0.
|
|
|
You can check this by running `php -v`. The output should look like this:
|
|
|
```bash
|
|
|
root@DietPi:/home/pi# php -v
|
|
|
root@DietPi:~# php -v
|
|
|
PHP 8.0.3 (cli) (built: Mar 5 2021 08:38:30) ( NTS )
|
|
|
Copyright (c) The PHP Group
|
|
|
Zend Engine v4.0.3, Copyright (c) Zend Technologies
|
|
|
with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
|
|
|
|
|
|
```
|
|
|
|
|
|
If it doesn't, you should use `update-alternatives --config php` and set PHP 8.0 as default:
|
|
|
```bash
|
|
|
root@DietPi:/home/pi# update-alternatives --config php
|
|
|
root@DietPi:~# update-alternatives --config php
|
|
|
There are 2 choices for the alternative php (providing /usr/bin/php).
|
|
|
|
|
|
Selection Path Priority Status
|
... | ... | |