Upgrade to PHP 7.4

I found the following warnings in the Security & setup warnings settings of Nexcloud:

You are currently running PHP 7.3.31-1~deb10u1. Upgrade your PHP version to take advantage of performance and security updates provided by the PHP Group as soon as your distribution supports it.

Nextcloud 23 is the last release supporting PHP 7.3. Nextcloud 24 requires at least PHP 7.4.

So I installed php 7.4. This is what I get when I run php -v:

PHP 7.4.29 (cli) (built: Apr 22 2022 06:44:32) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies

However the warnings won’t go away.

I’m on version 23.0.5 of Nextcloud.

What am I doing wrong? I am new to Linux.

You need to “disconnected” 7.3 and connect 7.4. I am also not good with linux, i will look at my notes today. I also upgraded from 7.3 to 7.4.

I think it was:

A2dismod php7.3
A2enmod php7.4

I used this:

https://wiki.debian.org/UnattendedUpgrades

apart from what @Operations wrote… search the forum as there are several threads about that (or similar) problems

If you use nginx and php 7.4, edit these files (i run debian 11)…

  1. php.ini:
    upload_max_filesize = 10240M
    memory_limit = 512M

  2. /etc/php/7.4/fpm/conf.d/10-opcache.ini
    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=256
    opcache.save_comments=1
    opcache.revalidate_freq=1
    opcache.validate_timestamps=1

  3. www.conf:
    listen = /run/php/php7.4-fpm.sock

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

pm = dynamic
pm.max_children = 120
pm.start_servers = 12
pm.min_spare_servers = 6
pm.max_spare_servers = 18

  1. /etc/php/7.4/mods-available/apcu.ini
    extension=apcu.so
    apc.enabled=1
    apc.shm_size=32M
    apc.ttl=7200
    apc.enable_cli=1

  2. change php-version in /etc/nginx/conf.d/nextcloud.conf
    upstream php-handler {
    server unix:/run/php/php7.4-fpm.sock;
    }

@Operations, Thank you for the suggestion. When I ran those commands, followed by sudo service apache2 restart the site stopped working. The following text was being displayed in the browser:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Not knowing which server logs to examine, I attempted syslog and nextcloud.log but didn’t find anything useful to me, possibly because I didn’t know what I was looking at.

When I reversed the process, the site came back up.

@abyss02, thank you for your suggestion. I’m on Debian Gnu 10. Do you happen to know what applies to that?

Some how installing php8 got rid of this error.

How did you solve this?
After i did:

sudo apt update
sudo apt upgrade

php -v shows me PHP 8.1.6, but the NC GUI still shows me PHP 7.4.29.
So i also need to “tell” Nextcloud to start using PHP 8.

When i look at /etc/php/8.1 there is no apache2 directory. Which is present when i look at /etc/php/7.4 directory.

So i cannot edit php.ini in the path: /etc/php/8.1/apache2/

Before i break my own Nextcloud (which is on Debian), does this also work on Debian?

This is how I did it:

cd /etc/php/8.1/mods-available
nano php.ini
apc.enable_cli = 1