Nextcloud stuck in maintenance mode - php module cURL not installed

Hi there,

My nextcloud is stuck in maintenance mode running on Dietpi 7.0.2.

When I try to disable manually via

ncc maintenance:mode --off

I get:

PHP Warning:  PHP Startup: Unable to load dynamic library 'curl.so' (tried: /usr/lib/php/20180731/curl.so (/usr/lib/php/20180731/curl.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/curl.so.so (/usr/lib/php/20180731/curl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP module cURL not installed.
Please ask your server administrator to install the module.

But when I try to install the module via

Sudo apt install curl

I get:

Curl is already the newest version (7.64.0-4+deb10u1).

A bit clueless here. Any help is much appreciated.

Would it be safe and helpful to reinstall nextcloud?

Thanks
T

Hi,

you would need to install/reinstall curl extension of php

apt install --reinstall php7.3-curl

I tried, but:

apt install --reinstall php7.3-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.3-curl : Depends: libcurl3 (>= 7.44.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

what Debian version you are running? echo $G_DISTRO_NAME and which PHP modules are installed dpkg -l php |grep ii

I am on buster (updated from stretch)

dpkg -l *php* |grep ii
ii  libapache2-mod-php8.0 8.0.3-1+0~20210305.17+debian9~1.gbp899a74         armhf        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                   2:8.0+81+0~20210223.34+debian9~1.gbpf52eb0        all          server-side, HTML-embedded scripting language (default)
ii  php-apcu              5.1.20+4.0.11-1+0~20210304.24+debian9~1.gbp1c3d4d armhf        APC User Cache for PHP
ii  php-common            2:81+0~20210223.34+debian9~1.gbpf52eb0            all          Common files for PHP packages
ii  php-igbinary          3.2.1+2.0.8-6+0~20210223.25+debian9~1.gbp4f4993   armhf        igbinary PHP serializer
ii  php-redis             5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4   armhf        PHP extension for interfacing with Redis
ii  php7.3-apcu           5.1.20+4.0.11-1+0~20210304.24+debian9~1.gbp1c3d4d armhf        APC User Cache for PHP
ii  php7.3-cli            7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        command-line interpreter for the PHP scripting language
ii  php7.3-common         7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        documentation, examples and common module for PHP
ii  php7.3-fpm            7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.3-gd             7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        GD module for PHP
ii  php7.3-igbinary       3.2.1+2.0.8-6+0~20210223.25+debian9~1.gbp4f4993   armhf        igbinary PHP serializer
ii  php7.3-intl           7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        Internationalisation module for PHP
ii  php7.3-json           7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        JSON module for PHP
ii  php7.3-mbstring       7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        MBSTRING module for PHP
ii  php7.3-mysql          7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        MySQL module for PHP
ii  php7.3-opcache        7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        Zend OpCache module for PHP
ii  php7.3-readline       7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        readline module for PHP
ii  php7.3-redis          5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4   armhf        PHP extension for interfacing with Redis
ii  php7.3-sqlite3        7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        SQLite3 module for PHP
ii  php7.3-xml            7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.3-zip            7.3.27-9+0~20210227.82+debian9~1.gbpa4a3d6        armhf        Zip module for PHP
ii  php8.0                8.0.3-1+0~20210305.17+debian9~1.gbp899a74         all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.0-apcu           5.1.20+4.0.11-1+0~20210304.24+debian9~1.gbp1c3d4d armhf        APC User Cache for PHP
ii  php8.0-cli            8.0.3-1+0~20210305.17+debian9~1.gbp899a74         armhf        command-line interpreter for the PHP scripting language
ii  php8.0-common         8.0.3-1+0~20210305.17+debian9~1.gbp899a74         armhf        documentation, examples and common module for PHP
ii  php8.0-igbinary       3.2.1+2.0.8-6+0~20210223.25+debian9~1.gbp4f4993   armhf        igbinary PHP serializer
ii  php8.0-opcache        8.0.3-1+0~20210305.17+debian9~1.gbp899a74         armhf        Zend OpCache module for PHP
ii  php8.0-readline       8.0.3-1+0~20210305.17+debian9~1.gbp899a74         armhf        readline module for PHP
ii  php8.0-redis          5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4   armhf        PHP extension for interfacing with Redis

are you sure you are on Buster? Because PHP seems to be still based on Stretch packages as they contain debian9

MichaIng can you have a look pls

I am sure after following MichaIng’s mini guide how to upgrade.

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

and apt update && apt upgrade didn’t show any package to update? right?

Only after I replaced stretch with buster in dietpi-php.list.

I seem to have missed that initially.

Now, dpkg -l php |grep ii gives

ii  libapache2-mod-php8.0 8.0.3-1+0~20210305.17+debian10~1.gbp899a74         armhf        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                   2:8.0+81+0~20210223.34+debian10~1.gbpf52eb0        all          server-side, HTML-embedded scripting language (default)
ii  php-apcu              5.1.20+4.0.11-1+0~20210304.24+debian10~1.gbp1c3d4d armhf        APC User Cache for PHP
ii  php-common            2:81+0~20210223.34+debian10~1.gbpf52eb0            all          Common files for PHP packages
ii  php-igbinary          3.2.1+2.0.8-6+0~20210223.25+debian10~1.gbp4f4993   armhf        igbinary PHP serializer
ii  php-redis             5.3.2+4.3.0-7+0~20210228.34+debian10~1.gbp893bd4   armhf        PHP extension for interfacing with Redis
ii  php7.3-apcu           5.1.20+4.0.11-1+0~20210304.24+debian10~1.gbp1c3d4d armhf        APC User Cache for PHP
ii  php7.3-cli            7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        command-line interpreter for the PHP scripting language
ii  php7.3-common         7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        documentation, examples and common module for PHP
ii  php7.3-fpm            7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.3-gd             7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        GD module for PHP
ii  php7.3-igbinary       3.2.1+2.0.8-6+0~20210223.25+debian10~1.gbp4f4993   armhf        igbinary PHP serializer
ii  php7.3-intl           7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        Internationalisation module for PHP
ii  php7.3-json           7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        JSON module for PHP
ii  php7.3-mbstring       7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        MBSTRING module for PHP
ii  php7.3-mysql          7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        MySQL module for PHP
ii  php7.3-opcache        7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        Zend OpCache module for PHP
ii  php7.3-readline       7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        readline module for PHP
ii  php7.3-redis          5.3.2+4.3.0-7+0~20210228.34+debian10~1.gbp893bd4   armhf        PHP extension for interfacing with Redis
ii  php7.3-sqlite3        7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        SQLite3 module for PHP
ii  php7.3-xml            7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.3-zip            7.3.27-9+0~20210227.82+debian10~1.gbpa4a3d6        armhf        Zip module for PHP
ii  php8.0                8.0.3-1+0~20210305.17+debian10~1.gbp899a74         all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.0-apcu           5.1.20+4.0.11-1+0~20210304.24+debian10~1.gbp1c3d4d armhf        APC User Cache for PHP
ii  php8.0-cli            8.0.3-1+0~20210305.17+debian10~1.gbp899a74         armhf        command-line interpreter for the PHP scripting language
ii  php8.0-common         8.0.3-1+0~20210305.17+debian10~1.gbp899a74         armhf        documentation, examples and common module for PHP
ii  php8.0-igbinary       3.2.1+2.0.8-6+0~20210223.25+debian10~1.gbp4f4993   armhf        igbinary PHP serializer
ii  php8.0-opcache        8.0.3-1+0~20210305.17+debian10~1.gbp899a74         armhf        Zend OpCache module for PHP
ii  php8.0-readline       8.0.3-1+0~20210305.17+debian10~1.gbp899a74         armhf        readline module for PHP
ii  php8.0-redis          5.3.2+4.3.0-7+0~20210228.34+debian10~1.gbp893bd4   armhf        PHP extension for interfacing with Redis

But dietpi-services restart results in

[FAILED] DietPi-Services | ncc maintenance:mode --on
[  OK  ] DietPi-Services | restart : proftpd
[  OK  ] DietPi-Services | restart : redis-server
[  OK  ] DietPi-Services | restart : mariadb
[  OK  ] DietPi-Services | restart : php7.3-fpm
[  OK  ] DietPi-Services | restart : lighttpd
[  OK  ] DietPi-Services | restart : noip2
[  OK  ] DietPi-Services | restart : cron

And NCC status says

This version of Nextcloud is not compatible with > PHP 7.4.<br/>You are currently running 8.0.3

MichaIng
do you think it is save to remove PHP8?

Solved it:

sudo update-alternatives --set php /usr/bin/php7.3
apt install --reinstall php7.3-curl

Nextcloud was up and running again using php7.3 now.

Did not uninstall 8.0

Thanks for your support.

T

ok good that it is working now.

It should be removed, and the meta package that always pulls the latest PHP major version from Ondrej’s repo: G_AGP php ‘php8.0*’

Latest Nextcloud 21 btw is PHP8.0-compatible, but probably not all other software titles.