|
|
## Before you start
|
|
|
- This tutorial was developed for and tested with DietPi 7.2 on a RaspberryPI.
|
|
|
- This tutorial only works if you use "Apache" as webserver.
|
|
|
Run `dietpi-software` and check the setting for "Webserver Preference".
|
|
|
- DietPi may behave differently on other systems.
|
|
|
- Nextcloud 21 is required _before_ upgrading to PHP 8.0.
|
|
|
- This does not work for DietPi Docker. You can't upgrade PHP in a Docker image.
|
... | ... | @@ -7,13 +9,16 @@ |
|
|
|
|
|
|
|
|
|
|
|
## 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:
|
|
|
Execute the following commands on your DietPi to add the repository PHP 8.0 from [deb.sury.org](https://deb.sury.org/#php-packages):
|
|
|
|
|
|
```bash
|
|
|
# Become root
|
|
|
sudo su
|
|
|
|
|
|
# Add the PHP PPA from deb.sury.org
|
|
|
apt-get -y install apt-transport-https lsb-release ca-certificates curl
|
|
|
curl -sSL -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
... | ... | @@ -21,13 +26,12 @@ sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/ |
|
|
apt-get update
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Install PHP 8.0
|
|
|
Execute the following command on your DietPi:
|
|
|
Execute the following command on your DietPi to install PHP 8.0:
|
|
|
|
|
|
```bash
|
|
|
# Become root
|
|
|
sudo su
|
|
|
|
|
|
# Install PHP 8.0
|
|
|
apt-get -y install libapache2-mod-php8.0 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
|
|
|
```
|
... | ... | @@ -51,11 +55,13 @@ a2enmod php8.0 |
|
|
systemctl restart apache2
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Check the PHP default version
|
|
|
By default, your NextCloudPi should now be using PHP 8.0.
|
|
|
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@nextcloudpi:/home/pi# php -v
|
|
|
root@DietPi:/home/pi# 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
|
... | ... | @@ -65,7 +71,7 @@ Zend Engine v4.0.3, Copyright (c) Zend Technologies |
|
|
|
|
|
If it doesn't, you should use `update-alternatives --config php` and set PHP 8.0 as default:
|
|
|
```bash
|
|
|
root@nextcloudpi:/home/pi# update-alternatives --config php
|
|
|
root@DietPi:/home/pi# update-alternatives --config php
|
|
|
There are 2 choices for the alternative php (providing /usr/bin/php).
|
|
|
|
|
|
Selection Path Priority Status
|
... | ... | |