How to update PHP NC 19.0.0?

You should not edit a symbolic link .That’s why it is a link. You should edit the target, which is in sites-available. But at the moment, there is no need to edit anything here.

As for the upgrade problem, I have to look up this. Did you do apt update before? Show us the complete error message.

I have successfully followed these steps to upgrade PHP from 7.2 to 7.4 on my Nextcloud instance provided by Hansson IT scripts. (outlined on my own site also : https://www.kaipee.co.uk/var/log/upgrade-php-nextcloud)

Update system and add php7.4 repo

sudo /bin/bash -c 'apt-get install software-properties-common && add-apt-repository ppa:ondrej/php && apt-get update && apt-get upgrade'

Install the most used PHP packages

sudo apt-get install php7.4 php7.4-cli php7.4-common php7.4-mysql php7.4-fpm php7.4-curl php7.4-opcache php7.4-apc libapache2-mod-php7.4 php7.4-mbstring php7.4-xml php7.4-gd php7.4-imagick php7.4-tidy php7.4-xmlrpc php7.4-bz2 php7.4-intl php7.4-json php7.4-imap php7.4-pspell php7.4-xsl php7.4-zip php-memcache php7.4-redis php7.4-smbclient php-pear php-zip

Ensure all previously used PHP modules are upgraded

sudo apt install $(apt list --installed | grep php7.2- | cut -d'/' -f1 | sed -e 's/7.2/7.4/g')

Manually check the PHP default version is changed

sudo update-alternatives --config php

Stop Apache and disable old PHP FPM prior to changes

sudo systemctl stop apache2
sudo systemctl stop php7.2-fpm
sudo systemctl disable php7.2-fpm

Replace FPM socket version in Apache configs

sudo cp /etc/apache2/sites-available/nextcloud_http_domain_self_signed.conf{,.bak}
sudo cp /etc/apache2/sites-available/nextcloud_ssl_domain_self_signed.conf{,.bak}
sudo sed -i -e s/php7.2/php7.4/g /etc/apache2/sites-enabled/nextcloud_http_domain_self_signed.conf
sudo sed -i -e s/php7.2/php7.4/g /etc/apache2/sites-enabled/nextcloud_ssl_domain_self_signed.conf

Move Hansson IT’s Nextcloud FPM config into place

sudo cp /etc/php/7.2/fpm/pool.d/nextcloud.conf /etc/php/7.4/fpm/pool.d/nextcloud.conf
sudo sed -i -e s/7.2/7.4/g /etc/php/7.4/fpm/pool.d/nextcloud.conf

Disable unused Apache mods and enable new mods

sudo /bin/bash -c 'a2enmod proxy_fcgi setenvif \
a2enconf php7.4-fpm \
a2dismod php7.2 \
a2dismod php7.2-fpm \
a2dismod php7.4 \
a2dismod mpm_fork \
a2dismod mpm_prefork \
a2enmod mpm_event'

Enable FPM service and restart Apache

sudo systemctl start php7.4-fpm
sudo systemctl enable php7.4-fpm
sudo systemctl start apache2
sudo systemctl enable apache2
1 Like

I noticed that Webmin showed me one update. So i tried to update, but i get the error:

The following packages have unmet dependencies:
libapache2-mod-php7.4 : Depends: php7.4-common (= 7.4.12-3+ubuntu18.04.1+deb.sury.org+1) but 7.4.8-1+ubuntu18.04.1+deb.sury.org+3 is to be installed
E: Unable to correct problems, you have held broken packages.

So i think there is still something i didn’t do right :slight_smile: Any ideas on how to solve this problem?

When i do apt get update and than apt get upgrade this does work, without any errors.