Advertisements

How to Fix Nextcloud Error: “This version of Nextcloud requires at least PHP 8.0”

  • Post last modified:October 21, 2023
  • Post category:Linux / Web
  • Post comments:5 Comments
  • Reading time:8 mins read

If you’re using Nextcloud, you may have encountered an error message stating, “This version of Nextcloud requires at least PHP 8.0. You are currently running 7.4.33. Please update your PHP version.” This error occurs when your server is running an older version of PHP that is not compatible with the New version of Nextcloud’s requirements. In this post, I will show how to remove the current PHP version and install PHP 8.2 to resolve this error.

nextcloud php 8.0 update error

Table of Contents:

Step 1: Check the Current PHP Version

The first step is to find the current PHP version running on your server:

php -v

This will display the current PHP version installed on your server. If the version is older than PHP 8.0, you need to upgrade to PHP 8.0 or higher to resolve the Nextcloud error.

Step 2: Remove the Current PHP Version

Advertisements

Before installing the New version of PHP, you need to remove the current PHP version from your server. To remove PHP:

For Ubuntu/Debian:

sudo apt purge php7.4*

For CentOS/RHEL:

sudo yum remove php*

Step 3: Add PHP 8.2 Repository

Once the current PHP version is removed, you need to add the PHP repository to your server. This repository provides the latest version of PHP 8.2 for your operating system. Here are the commands to add the repository:

For Ubuntu/Debian:

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

For CentOS/RHEL:

sudo yum install epel-release
sudo yum install yum-utils
sudo yum-config-manager --enable remi-php82

Step 4: Install PHP 8.2

install PHP 8.2 on your server:

For Ubuntu/Debian:

sudo apt update
sudo apt install php8.2 libapache2-mod-php8.2 php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc php8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-intl php8.2-bcmath php8.2-bz2 php8.2-zip -y

For CentOS/RHEL:

sudo yum update
sudo yum install php php-common php-mysqlnd php-xml php-xmlrpc php-curl php-gd php-imagick php-cli php-devel php-imap php-mbstring php-intl php-bcmath php-bz2 php-zip -y

Find all other modules here.

Step 5: Verify PHP Installation

Once the installation is complete, you can verify if PHP 8.2 is installed correctly on your server:

php -v

Step 6: Restart Web Server

You need to restart your web server to apply the changes:

For Ubuntu/Debian:

sudo service apache2 restart

Advertisements

For CentOS/RHEL:

sudo systemctl restart httpd

Step 7: Verify Nextcloud

Once the web server is restarted, Access your Nextcloud through a web browser and the error message is no longer displayed.

nextcloud install image

Conclusion

By following this post, you can successfully remove the current PHP version and install a new version of PHP to resolve the Nextcloud error. always backup your server and data before making any changes to your system to avoid data loss.

This Post Has 5 Comments

  1. Poem

    Error
    Can’t write into config directory!

    This can usually be fixed by giving the webserver write access to the config directory.

    1. Udara Kalana

      sudo chown -R www-data:www-data /var/www/html/
      sudo chmod -R 770 /var/www/html/

      change /var/www/html/ with your nextcloud directory

  2. noname

    you saved me thanks dude.

  3. Senorita

    update the post nextcloud use 8.2 at this time.

Leave a Reply