Nextcloud 20.02 internal server error after downgrading php


I am new here. (so I will probably do some “things” wrong!)

Running Nextcloud on Arch and 3 days ago I got a message that my NC (20.02) could not run with php 8. (only php 7.4)

Today I downgraded php to 7.4 but then I got “internal server error”.

I worked hard for weeks to get NC to work and until now itś been working fine for 4 months. I am unfortunately pretty lost here. Have tried with changeing permissions back and forth but I am a bit lost.

Anyone with a hint?


1 Like

Due to the fact that PHP up-/downgrade error related posts are addressed at least once a week, it should be an easy task to find hints on the forum using the search function in the upper right corner :wink:

The usual hint for this problem is, to check the Nextcloud and web server log files for php related errors and to make sure that all required php modules are correctly installed and configured.

I thank you for your answer!

I will try!


Hi again!

I have found a few php-errors

“PHP Warning: PHP Startup: Unable to load dynamic library ‘’ (tried: /usr/lib/php/modules/ (/usr/lib/php/modules/ undefined symbol: zend_call_known_function), /usr/lib/php/modules/ (/usr/lib/php/modules/ cannot open shared object file: No such file or directory)) in Unknown on line 0”

“PHP Warning: PHP Startup: Unable to load dynamic library ‘imagick’ (tried: /usr/lib/php/modules/imagick (/usr/lib/php/modules/imagick: cannot open shared object file: No such file or directory), /usr/lib/php/modules/ (/usr/lib/php/modules/ undefined symbol: instanceof_function_slow)) in Unknown on line 0”

“PHP Warning: PHP Startup: Unable to load dynamic library ‘redis’ (tried: /usr/lib/php/modules/redis (/usr/lib/php/modules/redis: cannot open shared object file: No such file or directory), /usr/lib/php/modules/ (/usr/lib/php/modules/ undefined symbol: _call_user_function_impl)) in Unknown on line 0
Could not open input file: occ”

All the above libraries are installed and in the right place! Why cant they be found?

Do I have to start over from the beginning or is this possible to fix?

Very thankful for any suggestions!


If the libraries would be available no errors were displayed, Try to get this problem fixed by reinstalling the php 7.4 modules and their dependencies. You can double-check the availability of all libraries by using the ldd command, like e.g.

ls -al /usr/lib/php/modules/
ldd /usr/lib/php/modules/

Thanks for hint! Did uninstall , reboot and then reinstalled and halted packed packages from updating i packagemanager.

ls -al and ldd gives positive answers but still I get this

"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."

Could it a permissions error?


As written, check the Nextcloud server log file for further information. Libraries are usually world readable so that it is very unlikely that a permission error causes the problem.

Thanks for answer. Been avoiding opening webserver log as it is nearly 2gb and nextcloud log is about 1,5gb. In console it is unreadable to me so I am trying geany now.


There is no need to open a whole file on Linux, just use e.g. the tail command to list the last n-lines of a log file and/or use grep to filter it, like e.g.

tail -n 100 nextcloud.log
tail -n 100 nextcloud.log | grep -E "error|failed"
tail -n 100 nextcloud.log | grep -E "error|failed" > /tmp/log-excerpt.txt

I lack basic knowledge of the console! I thank you for your help!

I think I found something;

{"reqId":"GFRmS2wSWZVgUBnG5WMw","level":3,"time":"2021-02-23T18:25:03+00:00","remoteAddr":"","user":"--","app":"remote","method":"GET","url":"/status.php","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: could not find driver","Code":0,"Trace"


1 Like

Unfortunately you didn’t provide any information about your environment, database etc., therefore I can only recommend to install and activate the required php database driver, e.g. php7.x-mysql if you’re using MySQL/MariaDB.

1 Like

I am sorry where and how do I provide info?

There are no php7-mysql/mariadb in Arch linux.

I have dropped database and created a new. Restarted services for nginx php-fpm and mariadb and then reboot.

After reboot no change.


1 Like

Your problem has nothing to do with Nextcloud as it, but your basic web server and php configuration, therefore reinstalling Nextcloud can never fix the problem. The following article might help you solving the problem:

Ok. Thanks. I will look at this again.


1 Like

I had the same problem and finally found out why. During the downgrade process, one of the removal dependencies got rid of my memcache module, php-apcu. I reinstalled it, and got no server error and everything worked.

1 Like

I had a second instance today in production that failed due to php8.0. After downgrading and purging, I got the same internal error as above. In this instance, it turned out that something in the php8.0 purge caused the entire mariadb-server package to be removed, so I apt install mariadb-server and it fixed it instantly.

This would suggest your database was partially broken like the post I just shared. In my case, Word Press - which is on the same host but a different apache virtual host - continued to work, but NC would not function until I reinstalled mariadb-server. Thus, removing php8.0 broke mariadb partially. This error suggests that your NC cannot connect to the db, so check to see whether your purge/removal borked your db too!?