Trying to reinstall nextcloud on Debian 11 system

My NextCloud server stopped working - doesn’t even give useful messages - just doesn’t showed a generic error with a suggestion I check the logs. The logs don’t show anything either - just a lot of app.php is deprecated errors that have been complained about by others. I don’t have anything on it that I need so I decided to reinstall.

I’ve followed the generic advice to purge nextcloud (remove nextcloud website folder and drop the tables from mariadb). Then I followed the guide at https://www.howtoforge.com/how-to-install-nextcloud-on-debian-11/ since it was specific to my OS. I’ve done all the initial stuff, adjusting the download to the latest 26.0.1.zip, but when I get down to " Nextcloud Installation" where I should set up the admin user, I get:
Error
No database drivers (sqlite, mysql, or postgresql) installed.
PHP module zip not installed.
Please ask your server administrator to install the module.
PHP module mbstring not installed.
Please ask your server administrator to install the module.
PHP module cURL not installed.
Please ask your server administrator to install the module.
PHP modules have been installed, but they are still listed as missing?
Please ask your server administrator to restart the web server.

To be clear, mariadb and the missing modules are installed and I’ve restarted apache2 several times. I’ve even rebooted the server.

Any ideas on what I’m doing wrong?

I think that I know the cause of your Problem.

Could you please paste the output of

dpkg -l | awk '/^ii.*php/ {print $2}'

and

apachectl -tD DUMP_INCLUDES | sed -n '/php.*conf/ s#.*/\([^/]*\)\.conf#\1#p'

With that information I’ll probably be able to help you in a targeted manner.

I suspect @ernolf likely has you well covered with your current issue (my thinking went the same direction as his so to avoid duplication I’ll leave that part of the thread to him), but I did want to highlight these two bits:

  1. Deprecation messages: This has gotten way better of late and further refinements are in the coming NC27. My production server logs are clear of deprecation messages unless I’m troubleshooting something actively with a high enough log level to trigger them. A mixture of log level adjustments NC developers have made in the past year and PHP version behavior differences have made this easier. Also, locally configured log levels and debug settings in one’s installation are a significant factor too (also for performance but that’s a different matter). I understand the frustration trying to to isolate the culprit of an issue with those mingled in though.
  2. There probably was something useful buried in between the deprecation messages. It would be highly unusual to have no clues as to the cause of a 500 or similar error. I suspect the “generic error” you’re referring was the basic web facing one which is that way to avoid exposing information publicly (to anyone accessing the URL) potentially private or vulnerability creating information. But when that generic message is generated at the web front end it always creates a more useful message (generally a stack strace) in the nextcloud.log accessible by the admin from the command line. I totally understand your lack of desire to troubleshoot it further, but if it occurs again feel free to come here and we’ll try to sort it out.

Good luck with the new installation!

dpkg -l | awk ‘/^ii.*php/ {print $2}’

libapache2-mod-php
libapache2-mod-php8.1
libapache2-mod-php8.2
php
php-apcu
php-auth-sasl
php-bcmath
php-bz2
php-cgi
php-cli
php-common
php-curl
php-dev
php-fpm
php-gd
php-gmp
php-imagick
php-intl
php-json
php-mail
php-mail-mime
php-mbstring
php-mysql
php-net-smtp
php-net-socket
php-pear
php-soap
php-xdebug
php-xml
php-zip
php7.4-cli
php7.4-common
php7.4-gd
php7.4-json
php7.4-opcache
php7.4-readline
php7.4-xml
php8.1-cgi
php8.1-cli
php8.1-common
php8.1-fpm
php8.1-gd
php8.1-opcache
php8.1-readline
php8.1-xml
php8.2
php8.2-apcu
php8.2-bcmath
php8.2-bz2
php8.2-cgi
php8.2-cli
php8.2-common
php8.2-curl
php8.2-dev
php8.2-fpm
php8.2-gd
php8.2-gmp
php8.2-imagick
php8.2-intl
php8.2-mbstring
php8.2-mysql
php8.2-opcache
php8.2-phpdbg
php8.2-readline
php8.2-soap
php8.2-xdebug
php8.2-xml
php8.2-zip
pkg-php-tools

and

apachectl -tD DUMP_INCLUDES | sed -n ‘/php.conf/ s#./([^/]*).conf#\1#p’

[Sat May 13 07:52:58.007529 2023] [so:warn] [pid 50618] AH01574: module php_module is already loaded, skipping
php8.1
php8.2
php8.1-fpm

  1. The deprecation messages stopped back around December. I’m not sure when the server started acting up because I mainly use it to backup stuff from my phone.
  2. The generic message wasn’t a web error. It seemed to be generated by nextcloud and said something to the effect the server has encountered an error. There were no messages in the log. Thinking the log might have had a size limit, I renamed it. A new empty log appeared when I tried to access nextcloud but no entries ever showed up.

OK, you have a classical php mess installed.

Do the following:

updated:

sudo apt-get remove *php*
sudo apt-get install php8.1-{apcu,bcmath,bz2,cli,common,curl,fpm,gd,gmp,igbinary,imagick,intl,mbstring,opcache,readline,xml,zip}

install the database extension of the database of your choice:

Database: pecl: php8.1-$pecl
MySQL/mariaDB mysql php8.1-mysql
PostgreSQL pgsql php8.1-pgsql
SQLite sqlite3 php8.1-sqlite3
sudo apt-get install php8.1-$pecl

Now you must decide, whether you want to use libapache2-mod-php or php-fpm The latter is the “fast process manager” and has http2 support (my recommendation).

If you want to use that one, you need to follow these steps:

Steps to activate php-fpm:

sudo a2dismod mpm_prefork
sudo a2enmod mpm_event proxy_fcgi setenvif
sudo a2enconf php8.1-fpm

and if you do NOT want to use php-fpm but libapache2-mod-php instead:

Steps to activate libapache2-mod-php:

sudo apt-get remove --purge php8.1-fpm php-fpm
sudo apt-get install libapache2-mod-php8.1

So read carefully, you should only activate one of both.


And finaly, if you want to use further pecl extensions like memcached or redis, smbclient, ldap (etc.) install them like this (replace $pecl with the extension you want to install):

sudo apt-get install php8.1-$pecl

When you are ready with all these steps, restart your apache2:

sudo systemctl restart apache2

(edit/update:)
As a final step, I would recommend fixing the php version from automatic to manual mode to 8.1 to prevent dependency packages from changing your php version without your knowledge:

sudo update-alternatives --get-selections | grep -E "ph(ar|p)" | sed 's/auto/manual/' | sudo update-alternatives --set-selections >/dev/null

Much luck

1 Like

Thanks. That did the trick!

2 Likes