Hello, I’m in a little pickle here. I’m currently on NC 30.x, running PHP 8.3, apache2 and Maria DB. I recently updated my Ubuntu server which also had php 8.3 updates in it. Since rebooting, I’m now getting an internal server error. I’ve checked the logs, but I don’t see anything that would be causing this. Not sure if others are experiencing this. Please, any thoughts on resolving this. Thanks in advance.
Did you already run the → php-updater ← script to fix php after the Ubuntu update?
If not yet: Do that first. That already could fix your php and solve the problem.
If not, you should fill out the support template and
… show us the log entries, because simply “Internal Server Error” after Ubuntu Update alone is not enough information then.
h.t.h.
Much and good luck,
ernolf
I had a very similar problem and eventually tracked it down to a problem in the config file after discovering (thanks to help here) that as well as the server logs nextcloud also has its own log /data/nexcloud.log
which was showing a memcache problem.
Simply deleting the line 'memcache.local' => '\OC\Memcache\APCu'
in \config\config.php
brought it back to life.
It would be helpful if the error message also referenced the nextcloud log - I had completely forgotten it existed.
Hey @rogerco , thanks so much for the tip. Looks like removing that line worked, but I also had to remove others pertaining to the memcahce shown below. I left line number 2 and removed 1 and 3 on the config file and it’s still working. But, not my instance have warnings. Prior to the Ubuntu system update, I had a green check .
- ‘memcache.local’ => ‘\OC\Memcache\APCu’,
- ‘memcache.locking’ => ‘\OC\Memcache\Redis’,
- ‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
Current Warnings below. Any thoughts please?
Thank you! @ernolf . I didn’t know this tool exist. Gives a lot PHP information. Looks like removing the following lines below on my config file sort of fixed it, but now I have warnings on my instance. I left line 2, since that didn’t give me an Internal Server issue. If you have any insight on this, please let us know. Thanks again for your assistance.
- ‘memcache.local’ => ‘\OC\Memcache\APCu’, (Removed from file)
- ‘memcache.locking’ => ‘\OC\Memcache\Redis’, (Left this line on the file)
- ‘memcache.distributed’ => ‘\OC\Memcache\Redis’, (Removed from file)
Analizing the logfile gives me this insight:
You are missing important modules and you did not run the script until the end and you did not asnwer with the sugested answers. That way, you won’t fix anything.
Your Apache Server is loaded with the mpm_prefork module which is needed for comunication with the apache2 handler (libapache2-mod-php) so you can deinstall php-fpm, those sockets it creates are not used while expensive in system resources.
OR switch from apache2 handler to the fast Process Manager which will give a better performance and http2, which is faster and more secure.
You should run the script completely, because parts of your php looks like are switched to 8.3 and other parts are switched to 8.4 while 8.1 and 8.2 are partialy installed as well.
It looks like the php8.3-apcu, php8.3-redis and php8.3-imagick modules are not installed, that could be the reason for the errors.
You should install them:
sudo apt-get install php8.3-apcu php8.3-redis php8.3-imagick
Then run the php-updater script, follow all recommendations for clean up unnecessary meta- and dependency packages and then run
sudo php-updater --switch-version
and choose php8.3 to switch to
Since you are using Nextcloud 30, you can finaly completely uninstall php8.4, as it is only supported from Nextcloud 31 onwards. PHP should always be handled according to the motto “as much as necessary, as little as possible” so that you get a lean, trouble-free server.
You can cleanup from php8.4:
sudo apt-get purge '*php8.4*'
you can do the same with the two older versions 8.1 and 8.2, after you migrated the settings to your new (8.3) version.
h.t.h.
Much and good luck,
ernolf
@ernolf , Thank you so much! Executing those commands, and re-adding the memcache lines now gives me a healthy system. I’m going to note this in case this happens again. Thanks again!
I am hapy that it works but your system is not yet realy healthy.
Call
php-fpm8.3 -t
it will give you this echo:
NOTICE: PHP message: PHP Warning: Module apcu is already loaded in Unknown on line 0
So you added a line to the configuration of php8.3-fpm that doesn’t belong there while php-fpm is not even used and you didn’t clean up your system according to the recommendations.
So it works: great! but “healthy” not yet.
ernolf
Yes, I did received that output, with a successful test. All this time I thought I was good. I’m sorry, when you can, is it possible to please provide what needs to be removed. Thanks again!
Run the php-pdater script and follow the recommendations, so simply accept the given answers. Do not quit prematurely. Then all errors should normaly be found and fixed.
ernolf