Internal Server Error due to php-gd loading issues with libx265

Nextcloud version (eg, 20.0.5): 28.0.0.11
Operating system and version (eg, Ubuntu 20.04): Debian GNU/Linux 12 (bookworm) x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.57
PHP version (eg, 7.4): 8.2.14 (cli)

I’ve been getting the errorr:

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.

I was dealing with issues regarding php-gd, which could not be loaded, see:

laslo@v2202208181276198316:/var/log$ php -version
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.2.14 (cli) (built: Dec 21 2023 20:18:00) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.14, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.14, Copyright (c), by Zend Technologies

The php install is quite messy.

More details not key to the issue

Yes, php-gd is installed:

laslo@v2202208181276198316:/var/log$ sudo apt search php-gd
Sortierung… Fertig
Volltextsuche… Fertig
php-gd/bullseye,now 2:8.2+93+0~20231125.47+debian11~1.gbpc7171d all  [installiert]
  GD-Modul für PHP (Standard)
laslo@v2202208181276198316:/usr/lib/php/20220829$ ls gd.so
gd.so

I’ve tried accessing occ for logs, but:

laslo@v2202208181276198316:/var/log$ sudo -u www-data php --define apc.enable_cli=1  /var/www/nextcloud/occ  maintenance:repair
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

Yes, php-apcu is installed:

php-apcu/bullseye,now 5.1.23-1+0~20231125.39+debian11~1.gbp8bf49a amd64  [installiert]
  APC User Cache for PHP

I’ve added a ‘help.php’ to the nextcloud install directory, which prints phpinfo(), and set error_log in the ini file which itself contains:

laslo@v2202208181276198316:/var/log$ sudo cat php_errors.log 
[23-Dec-2023 13:36:23 Europe/Berlin] PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[23-Dec-2023 13:39:02 Europe/Berlin] PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[23-Dec-2023 14:09:01 Europe/Berlin] PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

—Disclaimer not relevant to the question itself—
Now, I know my install is quite messy as when I set this up, I was not experienced at all with servers (I had some linux experience) and I suspect I did some things quite badly when setting this up, so this is very likely a mistake on my part.
I also know that it was dumb on my part to not back up nextcloud right before playing around, I do have a backup but it’s like 2 weeks old, sorry about that…
—End disclaimer—

Is this the first time you’ve seen this error? (Y/N): Y

The output of your Nextcloud log in Admin > Logging:

Not accessible

The output of your config.php file in /var/www/nextcloud/config (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.laslo-hauschild.eu',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.0.11',
  'overwrite.cli.url' => 'https://nextcloud.laslo-hauschild.eu',
  'dbname' => 'clouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'xxx',
  'default_phone_region' => 'DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'remember_login_cookie_lifetime' => 1296000,
  'session_lifetime' => 1800,
  'session_keepalive' => false,
  'auto_logout' => true,
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => 'xxx',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'mail_smtpsecure' => 'ssl',
  'app_install_overwrite' => 
  array (
    0 => 'apporder',
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => 'xxx',
);

The output of your Apache/nginx/system log in /var/log/____:

[Sat Dec 23 00:00:01.066249 2023] [mpm_prefork:notice] [pid 5137] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 00:00:01.066305 2023] [core:notice] [pid 5137] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 05:23:23.188925 2023] [proxy_fcgi:error] [pid 111829] [client 209.141.46.150:64393] AH01071: Got error 'Primary script unknown', referer: http://www.google.com.hk
[Sat Dec 23 06:18:52.391123 2023] [proxy_fcgi:error] [pid 111831] [client 198.98.58.38:57720] AH01071: Got error 'Primary script unknown', referer: http://www.google.com.hk
[Sat Dec 23 06:45:21.964983 2023] [proxy_fcgi:error] [pid 111831] [client 91.92.240.122:59834] AH01071: Got error 'Primary script unknown'
[Sat Dec 23 09:29:16.627398 2023] [proxy_fcgi:error] [pid 111828] [client 134.122.37.174:34724] AH01071: Got error 'Primary script unknown'
[Sat Dec 23 11:48:47.653229 2023] [access_compat:error] [pid 111831] [client 78.35.61.244:54146] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Sat Dec 23 11:55:28.733104 2023] [proxy_fcgi:error] [pid 120769] [client 78.35.61.244:47392] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 218211416 bytes) in /var/www/nextcloud/updater/index.php on line 712'
[Sat Dec 23 11:55:40.043919 2023] [access_compat:error] [pid 120557] [client 78.35.61.244:46598] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Sat Dec 23 11:58:58.499726 2023] [mpm_prefork:notice] [pid 5137] AH00170: caught SIGWINCH, shutting down gracefully
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sat Dec 23 11:58:58.735520 2023] [mpm_prefork:notice] [pid 148275] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 11:58:58.735593 2023] [core:notice] [pid 148275] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 12:00:09.958599 2023] [access_compat:error] [pid 149198] [client 78.35.61.244:54272] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Sat Dec 23 12:09:08.642087 2023] [access_compat:error] [pid 148310] [client 78.35.61.244:35042] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Sat Dec 23 12:30:21.011402 2023] [mpm_prefork:notice] [pid 148275] AH00171: Graceful restart requested, doing restart
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sat Dec 23 12:30:21.207354 2023] [mpm_prefork:notice] [pid 148275] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 12:30:21.207387 2023] [core:notice] [pid 148275] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 12:46:03.462525 2023] [mpm_prefork:notice] [pid 148275] AH00170: caught SIGWINCH, shutting down gracefully
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sat Dec 23 12:46:22.816606 2023] [mpm_prefork:notice] [pid 756] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 12:46:22.816814 2023] [core:notice] [pid 756] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 12:55:35.681559 2023] [mpm_prefork:notice] [pid 756] AH00170: caught SIGWINCH, shutting down gracefully
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sat Dec 23 12:55:35.913661 2023] [mpm_prefork:notice] [pid 1066] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 12:55:35.913740 2023] [core:notice] [pid 1066] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 13:04:55.907570 2023] [mpm_prefork:notice] [pid 1066] AH00170: caught SIGWINCH, shutting down gracefully
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sat Dec 23 13:05:14.039404 2023] [mpm_prefork:notice] [pid 730] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 13:05:14.039516 2023] [core:notice] [pid 730] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 13:32:58.285838 2023] [mpm_prefork:notice] [pid 730] AH00170: caught SIGWINCH, shutting down gracefully
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sat Dec 23 13:32:58.540443 2023] [mpm_prefork:notice] [pid 1520] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sat Dec 23 13:32:58.540522 2023] [core:notice] [pid 1520] AH00094: Command line: '/usr/sbin/apache2'
[Sat Dec 23 13:47:49.408663 2023] [proxy_fcgi:error] [pid 1525] [client 78.35.61.244:52412] AH01071: Got error 'Primary script unknown'
[Sat Dec 23 13:47:56.808866 2023] [access_compat:error] [pid 1524] [client 78.35.61.244:40708] AH01797: client denied by server configuration: /var/www/nextcloud/config/config.php

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Last entry:

{"reqId":"3NMsG6AEBvkbrHjTSfpG","level":3,"time":"2023-12-17T20:32:08+00:00",

It looks like you have messed up the installation of gd.
php searches for gd.so.so while there is only a gd.so:

Did you install it yourself, I mean not from apt sources?

I will try to help you…
Could you please post the echoes of following commands please:

dpkg -l | awk '/^ii.*php/ {print $2}'
php -i | grep -C 10 "gd"
grep -rnH "gd.so" /etc/php

much luck,
ernolf

1 Like

First

$ dpkg -l | awk '/^ii.*php/ {print $2}'
libapache2-mod-php
libapache2-mod-php8.2
php
php-apcu
php-bcmath
php-cli
php-common
php-curl
php-fpm
php-gd
php-gmp
php-imagick
php-intl
php-mbstring
php-mysql
php-xml
php-zip
php8.2
php8.2-bcmath
php8.2-cli
php8.2-common
php8.2-curl
php8.2-fpm
php8.2-gd
php8.2-gmp
php8.2-intl
php8.2-mbstring
php8.2-mysql
php8.2-opcache
php8.2-readline
php8.2-xml
php8.2-zip
php8.3-apcu
php8.3-cli
php8.3-common
php8.3-imagick
php8.3-opcache
php8.3-phpdbg
php8.3-readline

Second:

$ php -i | grep -C 10 "gd"
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
/etc/php/8.2/cli/conf.d/15-xml.ini,
/etc/php/8.2/cli/conf.d/20-bcmath.ini,
/etc/php/8.2/cli/conf.d/20-calendar.ini,
/etc/php/8.2/cli/conf.d/20-ctype.ini,
/etc/php/8.2/cli/conf.d/20-curl.ini,
/etc/php/8.2/cli/conf.d/20-dom.ini,
/etc/php/8.2/cli/conf.d/20-exif.ini,
/etc/php/8.2/cli/conf.d/20-ffi.ini,
/etc/php/8.2/cli/conf.d/20-fileinfo.ini,
/etc/php/8.2/cli/conf.d/20-ftp.ini,
/etc/php/8.2/cli/conf.d/20-gd.ini,
/etc/php/8.2/cli/conf.d/20-gettext.ini,
/etc/php/8.2/cli/conf.d/20-gmp.ini,
/etc/php/8.2/cli/conf.d/20-iconv.ini,
/etc/php/8.2/cli/conf.d/20-intl.ini,
/etc/php/8.2/cli/conf.d/20-mbstring.ini,
/etc/php/8.2/cli/conf.d/20-mysqli.ini,
/etc/php/8.2/cli/conf.d/20-pdo_mysql.ini,
/etc/php/8.2/cli/conf.d/20-phar.ini,
/etc/php/8.2/cli/conf.d/20-posix.ini,
/etc/php/8.2/cli/conf.d/20-readline.ini,

Third:

$ grep -rnH "gd.so" /etc/php
/etc/php/8.1/mods-available/gd.ini:3:extension=gd.so
/etc/php/8.2/mods-available/gd.ini:3:extension=gd.so

No, I installed everything via apt.

Edit: Looking at the outputs above, i don’t exactly know why some packages are php8.3, this might be an issue since I run php8.2

The issue with libx265.so.192 is strange, because I would expect libx265.so.199.

Maybe another depending package like ffmpeg or imagemagick-6.q16 is not the appropriate version? But your php is mixed 8.2 and 8.3 which could be the cause of the problem as well. Read ahead for hints:


I noticed, that you have libapache2-mod-php8.2 and php8.2-fpm installed. Only one of those can be used, they are mutual exclusive.

If you do not know, which of both you are using, then look the echo of

sudo apachectl -M 2>/dev/null | grep mpm

If it answers mpm_event_module, then you are using php-fpm and if it answers mpm_prefork_module, then you are using libapache2-mod-php.

The other (not used one) can be removed.


The php8.3 comes there, because you have all those meta and dependency packages installed.

Meta packages are all the php packages without a version:

php-comon is NOT a meta package and is always needed.
while php8.2 (without a trailing -module) is a so caled dependcy package.

First of all, remove the php8.3* related packages, since they are not needed:

sudo apt-get purge php8.3*

then try to get rid of all those dependcy packages one by one and look, if it does not try to deinstall some other important packages depending on them.

Then you are missing some modules for php8.2:

sudo apt-get install php8.2-{apcu,bz2,igbinary,imagick,redis}

(redis of course only if you consider to use it)


If you are using php8.2-fpm, you should run

sudo systemctl restart apache2 php8.2-fpm

if you are using libapache2-mod-php8.2 only

sudo systemctl restart apache2

After you did these stepes, it may be possible that your issue is solved.


I am wondering why this directory exists. You do not have any php8.1 installed so the related directories should normaly be removed. Maybe they belong to the meta packages I mentioned above :thinking:

The output of

ls -lR /etc/php

and

ls -lR /usr/lib/php

(after you did the removal from my above hint) would give total information to understand that.

Much luck,
ernolf

Hey, thanks for all of your suggestions and tips. I’m glad we can try to figure this out! I’m going through all the suggestions as I write this.

This returns mod_prefork_module, so I removed php-fpm and php8.2-fpm. On the second one, it actually said something about apache, so I’m not sure if it was really not using it, see details:

laslo@v2202208181276198316:~$ sudo apachectl -M 2>/dev/null | grep mpm
[sudo] Passwort für laslo: 
 mpm_prefork_module (shared)
laslo@v2202208181276198316:~$ sudo apt remove php-fpm
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden Pakete werden ENTFERNT:
  php-fpm
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 0 nicht aktualisiert.
Nach dieser Operation werden 14,3 kB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] n
Abbruch.
laslo@v2202208181276198316:~$ sudo apt purge php-fpm
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden Pakete werden ENTFERNT:
  php-fpm*
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 0 nicht aktualisiert.
Nach dieser Operation werden 14,3 kB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] y
(Lese Datenbank ... 69379 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von php-fpm (2:8.2+93+0~20231125.47+debian11~1.gbpc7171d) ...
laslo@v2202208181276198316:~$ sudo apt purge php8.2-fpm
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden Pakete werden ENTFERNT:
  php8.2-fpm*
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 0 nicht aktualisiert.
Nach dieser Operation werden 5.727 kB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] j
(Lese Datenbank ... 69376 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von php8.2-fpm (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Conf php8.2-fpm disabled.
apache2_invoke prerm: Disable configuration php8.2-fpm
Trigger für man-db (2.11.2-2) werden verarbeitet ...
(Lese Datenbank ... 69360 Dateien und Verzeichnisse sind derzeit installiert.)
Löschen der Konfigurationsdateien von php8.2-fpm (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
apache2_invoke postrm: Purging state for php8.2-fpm

The help.php is still reachable though, now loading the default config file.
Some new log details:

php8.2-fpm:

[24-Dec-2023 12:05:59] NOTICE: Terminating ...
[24-Dec-2023 12:05:59] NOTICE: exiting, bye-bye!

apache error log:

[Sun Dec 24 12:06:00.367331 2023] [mpm_prefork:notice] [pid 1520] AH00171: Graceful restart requested, doing restart
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sun Dec 24 12:06:00.627588 2023] [mpm_prefork:notice] [pid 1520] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sun Dec 24 12:06:00.627795 2023] [core:notice] [pid 1520] AH00094: Command line: '/usr/sbin/apache2'

The debug commands from your first post didn’t change except php-fpm for missing, which is expected.

Did that.
I am not sure which packages you want me to remove. When I try to remove php8.2 for example, it tries to remove php along with it, and the other way around. What’s the best practice here? For now, I’ve just removed the meta stuff and marked the php8.2-{…} as explicitly installed:

laslo@v2202208181276198316:/var/log/apache2$ sudo apt install php8.2
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
php8.2 ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2 wurde als manuell installiert festgelegt.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
laslo@v2202208181276198316:/var/log/apache2$ sudo apt install php8.2-{bcmath,cli,common,curl,gd,gmp,intl,mbstring,mysql,opcache,readline,xml,zip}
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
php8.2-bcmath ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-bcmath wurde als manuell installiert festgelegt.
php8.2-cli ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-cli wurde als manuell installiert festgelegt.
php8.2-common ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-common wurde als manuell installiert festgelegt.
php8.2-curl ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-curl wurde als manuell installiert festgelegt.
php8.2-gd ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-gd wurde als manuell installiert festgelegt.
php8.2-gmp ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-gmp wurde als manuell installiert festgelegt.
php8.2-intl ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-intl wurde als manuell installiert festgelegt.
php8.2-mbstring ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-mbstring wurde als manuell installiert festgelegt.
php8.2-mysql ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-mysql wurde als manuell installiert festgelegt.
php8.2-opcache ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-opcache wurde als manuell installiert festgelegt.
php8.2-readline ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-readline wurde als manuell installiert festgelegt.
php8.2-xml ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-xml wurde als manuell installiert festgelegt.
php8.2-zip ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-zip wurde als manuell installiert festgelegt.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

Then I removed all meta packages, now the following are installed:

laslo@v2202208181276198316:/var/log/apache2$ dpkg -l | awk '/^ii.*php/ {print $2}'
libapache2-mod-php8.2
php-common
php8.2
php8.2-bcmath
php8.2-cli
php8.2-common
php8.2-curl
php8.2-gd
php8.2-gmp
php8.2-intl
php8.2-mbstring
php8.2-mysql
php8.2-opcache
php8.2-readline
php8.2-xml
php8.2-zip

Finally, adding the missing dependencies:

laslo@v2202208181276198316:/var/log/apache2$ dpkg -l | awk '/^ii.*php/ {print $2}'
libapache2-mod-php8.2
php-common
php8.2
php8.2-apcu
php8.2-bcmath
php8.2-bz2
php8.2-cli
php8.2-common
php8.2-curl
php8.2-gd
php8.2-gmp
php8.2-igbinary
php8.2-imagick
php8.2-intl
php8.2-mbstring
php8.2-mysql
php8.2-opcache
php8.2-readline
php8.2-redis
php8.2-xml
php8.2-zip

Restarting apache: Nextcloud works! :partying_face:
Except it doesn’t work, it now loads a web page telling me php-gdis missing.

Fehler
PHP-Modul GD nicht installiert.

Now for the ls commands:

laslo@v2202208181276198316:/var/log/apache2$ ls -lR /etc/php
/etc/php:
insgesamt 8
drwxr-xr-x 7 root root 4096  1. Apr 2023  8.1
drwxr-xr-x 5 root root 4096 24. Dez 12:06 8.2

/etc/php/8.1:
insgesamt 20
drwxr-xr-x 2 root root 4096 17. Dez 12:45 apache2
drwxr-xr-x 2 root root 4096 17. Dez 12:45 cgi
drwxr-xr-x 2 root root 4096 17. Dez 12:45 cli
drwxr-xr-x 3 root root 4096 17. Dez 12:45 fpm
drwxr-xr-x 2 root root 4096  9. Dez 20:14 mods-available

/etc/php/8.1/apache2:
insgesamt 72
-rw-r--r-- 1 root root 73625  2. Apr 2023  php.ini

/etc/php/8.1/cgi:
insgesamt 72
-rw-r--r-- 1 root root 73623 16. Mär 2023  php.ini

/etc/php/8.1/cli:
insgesamt 72
-rw-r--r-- 1 root root 73622  1. Apr 2023  php.ini

/etc/php/8.1/fpm:
insgesamt 84
-rw-r--r-- 1 root root  5457 16. Mär 2023  php-fpm.conf
-rw-r--r-- 1 root root 73624  1. Apr 2023  php.ini
drwxr-xr-x 2 root root  4096  9. Dez 20:14 pool.d

/etc/php/8.1/fpm/pool.d:
insgesamt 24
-rw-r--r-- 1 root root 21306 16. Mär 2023  www.conf

/etc/php/8.1/mods-available:
insgesamt 160
-rw-r--r-- 1 root root  18  9. Dez 2022  apcu.ini
-rw-r--r-- 1 root root  72 16. Mär 2023  bcmath.ini
-rw-r--r-- 1 root root  74 16. Mär 2023  calendar.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  ctype.ini
-rw-r--r-- 1 root root  68 16. Mär 2023  curl.ini
-rw-r--r-- 1 root root  66 16. Mär 2023  dom.ini
-rw-r--r-- 1 root root  70 16. Mär 2023  exif.ini
-rw-r--r-- 1 root root  69 16. Mär 2023  ffi.ini
-rw-r--r-- 1 root root  74 16. Mär 2023  fileinfo.ini
-rw-r--r-- 1 root root  69 16. Mär 2023  ftp.ini
-rw-r--r-- 1 root root  64 16. Mär 2023  gd.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  gettext.ini
-rw-r--r-- 1 root root  66 16. Mär 2023  gmp.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  iconv.ini
-rw-r--r-- 1 root root 364  7. Feb 2023  igbinary.ini
-rw-r--r-- 1 root root  60  9. Dez 2022  imagick.ini
-rw-r--r-- 1 root root  68 16. Mär 2023  intl.ini
-rw-r--r-- 1 root root  76 16. Mär 2023  mbstring.ini
-rw-r--r-- 1 root root 176 10. Dez 2022  memcached.ini
-rw-r--r-- 1 root root  74  9. Dez 2022  msgpack.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  mysqli.ini
-rw-r--r-- 1 root root  72 16. Mär 2023  mysqlnd.ini
-rw-r--r-- 1 root root  95 16. Mär 2023  opcache.ini
-rw-r--r-- 1 root root  69 16. Mär 2023  pdo.ini
-rw-r--r-- 1 root root  74 16. Mär 2023  pdo_mysql.ini
-rw-r--r-- 1 root root  70 16. Mär 2023  phar.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  posix.ini
-rw-r--r-- 1 root root  76 16. Mär 2023  readline.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  shmop.ini
-rw-r--r-- 1 root root  72 16. Mär 2023  simplexml.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sockets.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sysvmsg.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sysvsem.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sysvshm.ini
-rw-r--r-- 1 root root  75 16. Mär 2023  tokenizer.ini
-rw-r--r-- 1 root root  66 16. Mär 2023  xml.ini
-rw-r--r-- 1 root root  72 16. Mär 2023  xmlreader.ini
-rw-r--r-- 1 root root  72 16. Mär 2023  xmlwriter.ini
-rw-r--r-- 1 root root  66 16. Mär 2023  xsl.ini
-rw-r--r-- 1 root root  66 16. Mär 2023  zip.ini

/etc/php/8.2:
insgesamt 12
drwxr-xr-x 3 root root 4096 17. Dez 12:16 apache2
drwxr-xr-x 3 root root 4096 23. Dez 12:30 cli
drwxr-xr-x 2 root root 4096 24. Dez 12:37 mods-available

/etc/php/8.2/apache2:
insgesamt 80
drwxr-xr-x 2 root root  4096 24. Dez 12:37 conf.d
-rw-r--r-- 1 root root 73891 24. Nov 14:10 php.ini

/etc/php/8.2/apache2/conf.d:
insgesamt 0
lrwxrwxrwx 1 root root 39 17. Dez 12:16 10-mysqlnd.ini -> /etc/php/8.2/mods-available/mysqlnd.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 10-pdo.ini -> /etc/php/8.2/mods-available/pdo.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 15-xml.ini -> /etc/php/8.2/mods-available/xml.ini
lrwxrwxrwx 1 root root 36 24. Dez 12:37 20-apcu.ini -> /etc/php/8.2/mods-available/apcu.ini
lrwxrwxrwx 1 root root 38 17. Dez 12:16 20-bcmath.ini -> /etc/php/8.2/mods-available/bcmath.ini
lrwxrwxrwx 1 root root 35 24. Dez 12:37 20-bz2.ini -> /etc/php/8.2/mods-available/bz2.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-calendar.ini -> /etc/php/8.2/mods-available/calendar.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-ctype.ini -> /etc/php/8.2/mods-available/ctype.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-curl.ini -> /etc/php/8.2/mods-available/curl.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-dom.ini -> /etc/php/8.2/mods-available/dom.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-exif.ini -> /etc/php/8.2/mods-available/exif.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-ffi.ini -> /etc/php/8.2/mods-available/ffi.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-fileinfo.ini -> /etc/php/8.2/mods-available/fileinfo.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-ftp.ini -> /etc/php/8.2/mods-available/ftp.ini
lrwxrwxrwx 1 root root 34 17. Dez 12:16 20-gd.ini -> /etc/php/8.2/mods-available/gd.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-gettext.ini -> /etc/php/8.2/mods-available/gettext.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-gmp.ini -> /etc/php/8.2/mods-available/gmp.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-iconv.ini -> /etc/php/8.2/mods-available/iconv.ini
lrwxrwxrwx 1 root root 40 24. Dez 12:37 20-igbinary.ini -> /etc/php/8.2/mods-available/igbinary.ini
lrwxrwxrwx 1 root root 39 24. Dez 12:37 20-imagick.ini -> /etc/php/8.2/mods-available/imagick.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-intl.ini -> /etc/php/8.2/mods-available/intl.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-mbstring.ini -> /etc/php/8.2/mods-available/mbstring.ini
lrwxrwxrwx 1 root root 38 17. Dez 12:16 20-mysqli.ini -> /etc/php/8.2/mods-available/mysqli.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-pdo_mysql.ini -> /etc/php/8.2/mods-available/pdo_mysql.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-phar.ini -> /etc/php/8.2/mods-available/phar.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-posix.ini -> /etc/php/8.2/mods-available/posix.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-readline.ini -> /etc/php/8.2/mods-available/readline.ini
lrwxrwxrwx 1 root root 37 24. Dez 12:37 20-redis.ini -> /etc/php/8.2/mods-available/redis.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-shmop.ini -> /etc/php/8.2/mods-available/shmop.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-simplexml.ini -> /etc/php/8.2/mods-available/simplexml.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sockets.ini -> /etc/php/8.2/mods-available/sockets.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sysvmsg.ini -> /etc/php/8.2/mods-available/sysvmsg.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sysvsem.ini -> /etc/php/8.2/mods-available/sysvsem.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sysvshm.ini -> /etc/php/8.2/mods-available/sysvshm.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-tokenizer.ini -> /etc/php/8.2/mods-available/tokenizer.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-xmlreader.ini -> /etc/php/8.2/mods-available/xmlreader.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-xmlwriter.ini -> /etc/php/8.2/mods-available/xmlwriter.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-xsl.ini -> /etc/php/8.2/mods-available/xsl.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-zip.ini -> /etc/php/8.2/mods-available/zip.ini

/etc/php/8.2/cli:
insgesamt 80
drwxr-xr-x 2 root root  4096 24. Dez 12:37 conf.d
-rw-r--r-- 1 root root 73887 23. Dez 12:30 php.ini

/etc/php/8.2/cli/conf.d:
insgesamt 0
lrwxrwxrwx 1 root root 39 17. Dez 12:16 10-mysqlnd.ini -> /etc/php/8.2/mods-available/mysqlnd.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 10-pdo.ini -> /etc/php/8.2/mods-available/pdo.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 15-xml.ini -> /etc/php/8.2/mods-available/xml.ini
lrwxrwxrwx 1 root root 36 24. Dez 12:37 20-apcu.ini -> /etc/php/8.2/mods-available/apcu.ini
lrwxrwxrwx 1 root root 38 17. Dez 12:16 20-bcmath.ini -> /etc/php/8.2/mods-available/bcmath.ini
lrwxrwxrwx 1 root root 35 24. Dez 12:37 20-bz2.ini -> /etc/php/8.2/mods-available/bz2.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-calendar.ini -> /etc/php/8.2/mods-available/calendar.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-ctype.ini -> /etc/php/8.2/mods-available/ctype.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-curl.ini -> /etc/php/8.2/mods-available/curl.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-dom.ini -> /etc/php/8.2/mods-available/dom.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-exif.ini -> /etc/php/8.2/mods-available/exif.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-ffi.ini -> /etc/php/8.2/mods-available/ffi.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-fileinfo.ini -> /etc/php/8.2/mods-available/fileinfo.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-ftp.ini -> /etc/php/8.2/mods-available/ftp.ini
lrwxrwxrwx 1 root root 34 17. Dez 12:16 20-gd.ini -> /etc/php/8.2/mods-available/gd.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-gettext.ini -> /etc/php/8.2/mods-available/gettext.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-gmp.ini -> /etc/php/8.2/mods-available/gmp.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-iconv.ini -> /etc/php/8.2/mods-available/iconv.ini
lrwxrwxrwx 1 root root 40 24. Dez 12:37 20-igbinary.ini -> /etc/php/8.2/mods-available/igbinary.ini
lrwxrwxrwx 1 root root 39 24. Dez 12:37 20-imagick.ini -> /etc/php/8.2/mods-available/imagick.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-intl.ini -> /etc/php/8.2/mods-available/intl.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-mbstring.ini -> /etc/php/8.2/mods-available/mbstring.ini
lrwxrwxrwx 1 root root 38 17. Dez 12:16 20-mysqli.ini -> /etc/php/8.2/mods-available/mysqli.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-pdo_mysql.ini -> /etc/php/8.2/mods-available/pdo_mysql.ini
lrwxrwxrwx 1 root root 36 17. Dez 12:16 20-phar.ini -> /etc/php/8.2/mods-available/phar.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-posix.ini -> /etc/php/8.2/mods-available/posix.ini
lrwxrwxrwx 1 root root 40 17. Dez 12:16 20-readline.ini -> /etc/php/8.2/mods-available/readline.ini
lrwxrwxrwx 1 root root 37 24. Dez 12:37 20-redis.ini -> /etc/php/8.2/mods-available/redis.ini
lrwxrwxrwx 1 root root 37 17. Dez 12:16 20-shmop.ini -> /etc/php/8.2/mods-available/shmop.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-simplexml.ini -> /etc/php/8.2/mods-available/simplexml.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sockets.ini -> /etc/php/8.2/mods-available/sockets.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sysvmsg.ini -> /etc/php/8.2/mods-available/sysvmsg.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sysvsem.ini -> /etc/php/8.2/mods-available/sysvsem.ini
lrwxrwxrwx 1 root root 39 17. Dez 12:16 20-sysvshm.ini -> /etc/php/8.2/mods-available/sysvshm.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-tokenizer.ini -> /etc/php/8.2/mods-available/tokenizer.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-xmlreader.ini -> /etc/php/8.2/mods-available/xmlreader.ini
lrwxrwxrwx 1 root root 41 17. Dez 12:16 20-xmlwriter.ini -> /etc/php/8.2/mods-available/xmlwriter.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-xsl.ini -> /etc/php/8.2/mods-available/xsl.ini
lrwxrwxrwx 1 root root 35 17. Dez 12:16 20-zip.ini -> /etc/php/8.2/mods-available/zip.ini

/etc/php/8.2/mods-available:
insgesamt 160
-rw-r--r-- 1 root root  35 17. Dez 13:15 apcu.ini
-rw-r--r-- 1 root root  72 16. Mär 2023  bcmath.ini
-rw-r--r-- 1 root root  66 21. Dez 21:18 bz2.ini
-rw-r--r-- 1 root root  74 16. Mär 2023  calendar.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  ctype.ini
-rw-r--r-- 1 root root  68 24. Nov 14:10 curl.ini
-rw-r--r-- 1 root root  66 24. Nov 14:10 dom.ini
-rw-r--r-- 1 root root  70 16. Mär 2023  exif.ini
-rw-r--r-- 1 root root  69 16. Mär 2023  ffi.ini
-rw-r--r-- 1 root root  74 16. Mär 2023  fileinfo.ini
-rw-r--r-- 1 root root  69 16. Mär 2023  ftp.ini
-rw-r--r-- 1 root root  64 24. Nov 14:10 gd.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  gettext.ini
-rw-r--r-- 1 root root  66 16. Mär 2023  gmp.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  iconv.ini
-rw-r--r-- 1 root root 364  2. Dez 18:34 igbinary.ini
-rw-r--r-- 1 root root  60 25. Nov 15:42 imagick.ini
-rw-r--r-- 1 root root  68 16. Mär 2023  intl.ini
-rw-r--r-- 1 root root  76 24. Nov 14:10 mbstring.ini
-rw-r--r-- 1 root root  71 24. Nov 14:10 mysqli.ini
-rw-r--r-- 1 root root  72 24. Nov 14:10 mysqlnd.ini
-rw-r--r-- 1 root root  96 23. Dez 13:25 opcache.ini
-rw-r--r-- 1 root root  69 16. Mär 2023  pdo.ini
-rw-r--r-- 1 root root  74 24. Nov 14:10 pdo_mysql.ini
-rw-r--r-- 1 root root  70 16. Mär 2023  phar.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  posix.ini
-rw-r--r-- 1 root root  76 24. Nov 14:10 readline.ini
-rw-r--r-- 1 root root  19 28. Nov 11:39 redis.ini
-rw-r--r-- 1 root root  71 16. Mär 2023  shmop.ini
-rw-r--r-- 1 root root  72 24. Nov 14:10 simplexml.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sockets.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sysvmsg.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sysvsem.ini
-rw-r--r-- 1 root root  73 16. Mär 2023  sysvshm.ini
-rw-r--r-- 1 root root  75 16. Mär 2023  tokenizer.ini
-rw-r--r-- 1 root root  66 24. Nov 14:10 xml.ini
-rw-r--r-- 1 root root  72 24. Nov 14:10 xmlreader.ini
-rw-r--r-- 1 root root  72 24. Nov 14:10 xmlwriter.ini
-rw-r--r-- 1 root root  66 24. Nov 14:10 xsl.ini
-rw-r--r-- 1 root root  66 24. Nov 14:10 zip.ini
laslo@v2202208181276198316:/var/log/apache2$ ls -lR /usr/lib/php
/usr/lib/php:
insgesamt 40
drwxr-xr-x 2 root root 4096 24. Dez 12:37 20220829
drwxr-xr-x 3 root root 4096 23. Dez 11:58 8.2
-rw-r--r-- 1 root root   13 25. Nov 09:23 packaging
-rwxr-xr-x 1 root root  514 25. Nov 09:23 php-fpm-socket-helper
-rw-r--r-- 1 root root 4845 25. Nov 09:23 php-helper
-rw-r--r-- 1 root root 9234 25. Nov 09:23 php-maintscript-helper
-rwxr-xr-x 1 root root 2976 25. Nov 09:23 sessionclean

/usr/lib/php/20220829:
insgesamt 13644
-rw-r--r-- 1 root root   88168 25. Nov 15:41 apcu.so
-rw-r--r-- 1 root root   39024 21. Dez 21:18 bcmath.so
-rw-r--r-- 1 root root   26728 21. Dez 21:18 bz2.so
-rw-r--r-- 1 root root   34920 21. Dez 21:18 calendar.so
-rw-r--r-- 1 root root   14440 21. Dez 21:18 ctype.so
-rw-r--r-- 1 root root  120936 21. Dez 21:18 curl.so
-rw-r--r-- 1 root root  194664 21. Dez 21:18 dom.so
-rw-r--r-- 1 root root   96360 21. Dez 21:18 exif.so
-rw-r--r-- 1 root root  178280 21. Dez 21:18 ffi.so
-rw-r--r-- 1 root root 7149728 21. Dez 21:18 fileinfo.so
-rw-r--r-- 1 root root   71784 21. Dez 21:18 ftp.so
-rw-r--r-- 1 root root  108648 21. Dez 21:18 gd.so
-rw-r--r-- 1 root root   14440 21. Dez 21:18 gettext.so
-rw-r--r-- 1 root root   71784 21. Dez 21:18 gmp.so
-rw-r--r-- 1 root root   51304 21. Dez 21:18 iconv.so
-rw-r--r-- 1 root root   80096  2. Dez 18:34 igbinary.so
-rw-r--r-- 1 root root  452752 25. Nov 15:42 imagick.so
-rw-r--r-- 1 root root  583880 21. Dez 21:18 intl.so
-rw-r--r-- 1 root root 1192704 21. Dez 21:18 mbstring.so
-rw-r--r-- 1 root root  161896 21. Dez 21:18 mysqli.so
-rw-r--r-- 1 root root  235216 21. Dez 21:18 mysqlnd.so
-rw-r--r-- 1 root root 1014664 21. Dez 21:18 opcache.so
-rw-r--r-- 1 root root   34920 21. Dez 21:18 pdo_mysql.so
-rw-r--r-- 1 root root  125032 21. Dez 21:18 pdo.so
-rw-r--r-- 1 root root  284776 21. Dez 21:18 phar.so
-rw-r--r-- 1 root root   39016 21. Dez 21:18 posix.so
-rw-r--r-- 1 root root   34920 21. Dez 21:18 readline.so
-rw-r--r-- 1 root root  842032 28. Nov 11:39 redis.so
-rw-r--r-- 1 root root   14440 21. Dez 21:18 shmop.so
-rw-r--r-- 1 root root   63592 21. Dez 21:18 simplexml.so
-rw-r--r-- 1 root root  104552 21. Dez 21:18 sockets.so
-rw-r--r-- 1 root root   22632 21. Dez 21:18 sysvmsg.so
-rw-r--r-- 1 root root   14440 21. Dez 21:18 sysvsem.so
-rw-r--r-- 1 root root   18536 21. Dez 21:18 sysvshm.so
-rw-r--r-- 1 root root   34920 21. Dez 21:18 tokenizer.so
-rw-r--r-- 1 root root   43112 21. Dez 21:18 xmlreader.so
-rw-r--r-- 1 root root   55400 21. Dez 21:18 xml.so
-rw-r--r-- 1 root root   51304 21. Dez 21:18 xmlwriter.so
-rw-r--r-- 1 root root   34920 21. Dez 21:18 xsl.so
-rw-r--r-- 1 root root   92264 21. Dez 21:18 zip.so

/usr/lib/php/8.2:
insgesamt 232
-rw-r--r-- 1 root root 73998 21. Dez 21:18 php.ini-development
-rw-r--r-- 1 root root 73891 21. Dez 21:18 php.ini-production
-rw-r--r-- 1 root root 73887 21. Dez 21:18 php.ini-production.cli
drwxr-xr-x 2 root root  4096 24. Dez 12:06 sapi

/usr/lib/php/8.2/sapi:
insgesamt 0
-rw-r--r-- 1 root root 0 21. Dez 21:18 apache2
-rw-r--r-- 1 root root 0 21. Dez 21:18 cli

This also confused me, as once I even found every major version of php since php5.? in there, like 10 folders. Thanks for your help so far!

Edit: My own debugging attemps (I’ll keep you updated):

  • Restart the whole server: No change
  • Enable gd in php.ini by removing ;and restarting apache: No change, so I undid change to php.ini
  • occ throws a different error!:
laslo@v2202208181276198316:~$ sudo -u www-data php  /var/www/nextcloud/occ  maintenance:repair
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP module GD not installed.
Please ask your server administrator to install the module.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:160
Stack trace:
#0 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once('...')
#2 {main}

This annoys me :woozy_face:

You could try the following horse cure if you dare:

sudo apt-get remove libx265-192

that will deinstall a lot of packages like ffmpeg, imagemagick, libav*, php8.2-imagick and php8.2-gd

Then do a

sudo apt-get update

After that is done, reinstall those two packages new “from scratch”:

sudo apt-get install php8.2-{gd,imagick}

and eventually ffmpeg if you rely on it.


That one is easy, simply run:

sudo rm -r /etc/php/8.1

under /usr/lib/php are no 8.1 zombie files.

Much luck,
ernolf

What can I tell you… This package isn’t installed.

laslo@v2202208181276198316:/var/www/laslo-hauschild.eu$ sudo apt-get remove libx265-192
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
E: Paket libx265-192 kann nicht gefunden werden.

However, some packages were installed when running the second command, and there are some warnings in sudo apt update (unfortuately i was to quick to clear the terminal for that output, but re-running shows the now installed packages):

laslo@v2202208181276198316:/var/www$ sudo apt-get install php8.2-{gd,imagick}
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
php8.2-gd ist schon die neueste Version (8.2.14-1+0~20231221.38+debian11~1.gbp698136).
php8.2-imagick ist schon die neueste Version (3.7.0-4+0~20231125.43+debian11~1.gbpbf7e27).
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  dictionaries-common dirmngr emacsen-common gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm ienglish-common ispell libalgorithm-diff-perl libassuan0 libcgi-pm-perl libchafa0
  libclang-cpp14 libencode-locale-perl libfakeroot libfcgi-perl libfcgi0ldbl libgail18 libgit2-1.5 libhtml-parser-perl libhtml-tagset-perl libhttp-date-perl libhttp-parser2.9 libio-html-perl libjxr0 libksba8
  liblwp-mediatypes-perl liblzo2-2 libmbedtls14 libmbedx509-1 libnetpbm11 libnpth0 libregexp-ipv6-perl libsixel1 libtimedate-perl liburi-perl libyaml-0-2 libz3-dev llvm-14-tools pinentry-curses
  python3-pygments python3-yaml toilet-fonts
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
laslo@v2202208181276198316:/var/www$ sudo apt update
OK:1 http://security.debian.org/debian-security bookworm-security InRelease
OK:2 http://deb.debian.org/debian bookworm InRelease                                                         
OK:3 http://deb.debian.org/debian bookworm-updates InRelease                                                 
OK:4 http://ftp.debian.org/debian bookworm-backports InRelease                                               
OK:5 https://packages.sury.org/php bullseye InRelease                                                        
Paketlisten werden gelesen… Fertig                           
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Alle Pakete sind aktuell.
W: https://packages.sury.org/php/dists/bullseye/InRelease: Schlüssel ist im veralteten Schlüsselbund trusted.gpg gespeichert (/etc/apt/trusted.gpg), siehe den Abschnitt MISSBILLIGUNG in apt-key(8) für Details.
N: Für das Depot »Debian bookworm« wurde der »non-free component«-Wert von »non-free« in »non-free non-free-firmware« geändert.
N: Weitere Informationen hierzu finden Sie online in den Veröffentlichungshinweisen unter https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split.

Ok. I am not on Debian!
what is the echo of

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

If that echoes a package, tha is what I meant :wink:

I only came to this because you had this error above

But if it is not installed, you could simply try:

sudo apt-get install --reinstall php8.2-gd

Maybe it is a good idea, to try this first and look if that alone is enough to get rid of the “PHP-Modul GD nicht installiert.” error.

Much luck,
ernolf

Pretty sure that regex is malformed, but if you meant (with the extra '):

laslo@v2202208181276198316:~$ dpkg -l | awk '/^ii.*libx265/ {print $2}'
libx265-199:amd64
libx265-dev:amd64

Reinstalling did not fix it. I have a very bad feeling though that I have sources issues. When reinstalling it said:

Holen:1 https://packages.sury.org/php bullseye/main amd64 php8.2-gd amd64 8.2.14-1+0~20231221.38+debian11~1.gbp698136 [28,6 kB]
Es wurden 28,6 kB in 0 s geholt (256 kB/s).

From sury.org bullseye. But i’m on bookworm. This probably is also the reason apt update returns a warning. I think I’ve installed old packages from a third-party-source all along.

That is a good one!

What is the echo of

grep -rnH ondrej /etc/apt/

and/or

grep -rnH bullseye /etc/apt/

Then you must replace all occurences of bullseye with bookworm

run

sudo apt-get update && apt-get upgrade

Much luck,
ernolf

Oh man, I really must have messed up. I remember following a tutorial for ubuntu but thought I switched before it got messy, anyways look at that:

laslo@v2202208181276198316:~$ grep -rnH ondrej /etc/apt/
/etc/apt/sources.list.d/ondrej-ubuntu-php-lunar.list:1:# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu lunar main
/etc/apt/sources.list.d/ondrej-ubuntu-php-lunar.list.save:1:# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu lunar main
laslo@v2202208181276198316:~$ cd /etc/apt/
laslo@v2202208181276198316:/etc/apt$ grep -rnH bullseye /etc/apt/
/etc/apt/sources.list.d/sury-php.list:1:deb https://packages.sury.org/php/ bullseye main

I removed a bunch of pgp keys and updated the sources.list.d:

laslo@v2202208181276198316:/etc/apt$ cat sources.list.d/php.list 
deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ bookworm main

I also took it upon myself to fix the sources.list, sudo apt update now works as expected. All php packages promptly received updates:

laslo@v2202208181276198316:/etc/apt$ sudo apt update
OK:1 http://deb.debian.org/debian bookworm InRelease
OK:2 http://deb.debian.org/debian-security bookworm-security InRelease               
OK:3 http://deb.debian.org/debian bookworm-updates InRelease                         
OK:4 https://packages.sury.org/php bookworm InRelease
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Aktualisierung für 22 Pakete verfügbar. Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.
laslo@v2202208181276198316:/etc/apt$ sudo apt upgrade
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Paketaktualisierung (Upgrade) wird berechnet… Fertig
Das folgende Paket wurde automatisch installiert und wird nicht mehr benötigt:
  libicu67
Verwenden Sie »sudo apt autoremove«, um es zu entfernen.
Die folgenden Pakete werden aktualisiert (Upgrade):
  libapache2-mod-php8.2 libpcre3 php-common php8.2 php8.2-apcu php8.2-bcmath php8.2-bz2 php8.2-cli php8.2-common php8.2-curl php8.2-gd php8.2-gmp php8.2-igbinary php8.2-imagick php8.2-intl php8.2-mbstring
  php8.2-mysql php8.2-opcache php8.2-readline php8.2-redis php8.2-xml php8.2-zip
22 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen 6.149 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 22,5 kB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] j
Holen:1 https://packages.sury.org/php bookworm/main amd64 php-common all 2:93+0~20231125.47+debian12~1.gbpc7171d [12,8 kB]
Holen:2 https://packages.sury.org/php bookworm/main amd64 php8.2-opcache amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [345 kB]
Holen:3 https://packages.sury.org/php bookworm/main amd64 php8.2-readline amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [12,5 kB]
Holen:4 https://packages.sury.org/php bookworm/main amd64 php8.2-cli amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [1.735 kB]
Holen:5 https://packages.sury.org/php bookworm/main amd64 libapache2-mod-php8.2 amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [1.674 kB]
Holen:6 https://packages.sury.org/php bookworm/main amd64 php8.2-zip amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [26,2 kB]
Holen:7 https://packages.sury.org/php bookworm/main amd64 php8.2-xml amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [112 kB]
Holen:8 https://packages.sury.org/php bookworm/main amd64 php8.2-mysql amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [117 kB]
Holen:9 https://packages.sury.org/php bookworm/main amd64 php8.2-mbstring amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [443 kB]
Holen:10 https://packages.sury.org/php bookworm/main amd64 php8.2-intl amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [139 kB]
Holen:11 https://packages.sury.org/php bookworm/main amd64 php8.2-gmp amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [21,9 kB]
Holen:12 https://packages.sury.org/php bookworm/main amd64 php8.2-gd amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [28,6 kB]
Holen:13 https://packages.sury.org/php bookworm/main amd64 php8.2-curl amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [35,8 kB]
Holen:14 https://packages.sury.org/php bookworm/main amd64 php8.2-bz2 amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [10,6 kB]
Holen:15 https://packages.sury.org/php bookworm/main amd64 php8.2-bcmath amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [15,4 kB]
Holen:16 https://packages.sury.org/php bookworm/main amd64 php8.2-common amd64 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [675 kB]
Holen:17 https://packages.sury.org/php bookworm/main amd64 php8.2-apcu amd64 5.1.23-1+0~20231125.39+debian12~1.gbp8bf49a [43,7 kB]
Holen:18 https://packages.sury.org/php bookworm/main amd64 php8.2-igbinary amd64 3.2.15-1+0~20231202.49+debian12~1.gbpe9ffe8 [34,3 kB]
Holen:19 https://packages.sury.org/php bookworm/main amd64 php8.2-imagick amd64 3.7.0-4+0~20231125.43+debian12~1.gbpbf7e27 [97,8 kB]
Holen:20 https://packages.sury.org/php bookworm/main amd64 php8.2-redis amd64 6.0.2-1+0~20231128.56+debian12~1.gbp9f3071 [188 kB]
Holen:21 https://packages.sury.org/php bookworm/main amd64 libpcre3 amd64 2:8.45-1+0~20230620.10+debian12~1.gbp8792c4 [348 kB]
Holen:22 https://packages.sury.org/php bookworm/main amd64 php8.2 all 8.2.14-1+0~20231221.38+debian12~1.gbp698136 [34,5 kB]
Es wurden 6.149 kB in 0 s geholt (13,4 MB/s).
(Lese Datenbank ... 60414 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../00-php-common_2%3a93+0~20231125.47+debian12~1.gbpc7171d_all.deb ...
Entpacken von php-common (2:93+0~20231125.47+debian12~1.gbpc7171d) über (2:93+0~20231125.47+debian11~1.gbpc7171d) ...
Vorbereitung zum Entpacken von .../01-php8.2-opcache_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-opcache (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../02-php8.2-readline_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-readline (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../03-php8.2-cli_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-cli (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../04-libapache2-mod-php8.2_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von libapache2-mod-php8.2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../05-php8.2-zip_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-zip (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../06-php8.2-xml_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-xml (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../07-php8.2-mysql_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-mysql (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../08-php8.2-mbstring_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-mbstring (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../09-php8.2-intl_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-intl (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../10-php8.2-gmp_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-gmp (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../11-php8.2-gd_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-gd (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../12-php8.2-curl_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-curl (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../13-php8.2-bz2_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-bz2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../14-php8.2-bcmath_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-bcmath (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
Vorbereitung zum Entpacken von .../15-php8.2-common_8.2.14-1+0~20231221.38+debian12~1.gbp698136_amd64.deb ...
Entpacken von php8.2-common (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
php-common (2:93+0~20231125.47+debian12~1.gbpc7171d) wird eingerichtet ...
(Lese Datenbank ... 60414 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../0-php8.2-apcu_5.1.23-1+0~20231125.39+debian12~1.gbp8bf49a_amd64.deb ...
Entpacken von php8.2-apcu (5.1.23-1+0~20231125.39+debian12~1.gbp8bf49a) über (5.1.23-1+0~20231125.39+debian11~1.gbp8bf49a) ...
Vorbereitung zum Entpacken von .../1-php8.2-igbinary_3.2.15-1+0~20231202.49+debian12~1.gbpe9ffe8_amd64.deb ...
Entpacken von php8.2-igbinary (3.2.15-1+0~20231202.49+debian12~1.gbpe9ffe8) über (3.2.15-1+0~20231202.49+debian11~1.gbpe9ffe8) ...
Vorbereitung zum Entpacken von .../2-php8.2-imagick_3.7.0-4+0~20231125.43+debian12~1.gbpbf7e27_amd64.deb ...
Entpacken von php8.2-imagick (3.7.0-4+0~20231125.43+debian12~1.gbpbf7e27) über (3.7.0-4+0~20231125.43+debian11~1.gbpbf7e27) ...
Vorbereitung zum Entpacken von .../3-php8.2-redis_6.0.2-1+0~20231128.56+debian12~1.gbp9f3071_amd64.deb ...
Entpacken von php8.2-redis (6.0.2-1+0~20231128.56+debian12~1.gbp9f3071) über (6.0.2-1+0~20231128.56+debian11~1.gbp9f3071) ...
Vorbereitung zum Entpacken von .../4-libpcre3_2%3a8.45-1+0~20230620.10+debian12~1.gbp8792c4_amd64.deb ...
Entpacken von libpcre3:amd64 (2:8.45-1+0~20230620.10+debian12~1.gbp8792c4) über (2:8.45-1+0~20230620.10+debian11~1.gbp8792c4) ...
Vorbereitung zum Entpacken von .../5-php8.2_8.2.14-1+0~20231221.38+debian12~1.gbp698136_all.deb ...
Entpacken von php8.2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) über (8.2.14-1+0~20231221.38+debian11~1.gbp698136) ...
php8.2-common (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-mysql (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-bz2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-bcmath (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-zip (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-opcache (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-readline (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-mbstring (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-intl (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
libpcre3:amd64 (2:8.45-1+0~20230620.10+debian12~1.gbp8792c4) wird eingerichtet ...
php8.2-curl (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-xml (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-gmp (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-gd (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-cli (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
php8.2-igbinary (3.2.15-1+0~20231202.49+debian12~1.gbpe9ffe8) wird eingerichtet ...
php8.2-imagick (3.7.0-4+0~20231125.43+debian12~1.gbpbf7e27) wird eingerichtet ...
php8.2-redis (6.0.2-1+0~20231128.56+debian12~1.gbp9f3071) wird eingerichtet ...
libapache2-mod-php8.2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
libapache2-mod-php8.2: not switching MPM - already enabled
php8.2-apcu (5.1.23-1+0~20231125.39+debian12~1.gbp8bf49a) wird eingerichtet ...
php8.2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) wird eingerichtet ...
Trigger für man-db (2.11.2-2) werden verarbeitet ...
Trigger für libc-bin (2.36-9+deb12u3) werden verarbeitet ...
Trigger für php8.2-cli (8.2.14-1+0~20231221.38+debian12~1.gbp698136) werden verarbeitet ...
Trigger für libapache2-mod-php8.2 (8.2.14-1+0~20231221.38+debian12~1.gbp698136) werden verarbeitet ...

Now, all packages are really up to date, yet the issue persits. But we are getting closer!
Apache still reports

PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/gd.so.so (/usr/lib/php/20220829/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Sun Dec 24 14:30:00.280987 2023] [mpm_prefork:notice] [pid 724] AH00163: Apache/2.4.57 (Debian) OpenSSL/3.0.11 configured -- resuming normal operations
[Sun Dec 24 14:30:00.281355 2023] [core:notice] [pid 724] AH00094: Command line: '/usr/sbin/apache2'

in the logs. Nextcloud stayed quiet in its logs. The last occ output update is the same rn. I think we need to dig into libx265.so a little bit more.

Quick sidenote:
Big thanks for helping me so far!!! I couldn’t have gotten this far this quick and I am really glad you helping me. Thanks!

Edit:
More info:

laslo@v2202208181276198316:/usr/lib/php/20220829$ sudo apt search libx265
Sortierung… Fertig
Volltextsuche… Fertig
libx265-199/stable,now 3.5-2+b1 amd64  [Installiert,automatisch]
  Codierer für H.265/HEVC-Videostreams (Laufzeitbibliothek)

libx265-dev/stable,now 3.5-2+b1 amd64  [installiert]
  Codierer für H.265/HEVC-Videostreams (Entwicklungsdateien)
1 Like

Finally solved it. Here is a guide for anyone running into problems with

  • a werid php installation
  • a libary (like php-gd) not loading libx265

Requirements for this solution are (probably)

  • Running debian (or at least a debian-based distro like ubuntu) Edit: Apparently the same issue appears elsewhere, see
  • Using apache

Many thanks to @ernolf for helping me to get to this solution.


What’s the issue? Your nextcloud doesn’t load and your logs say something about php issues.

Back up your system. It is never to late to do that (well, it is, but it’s still better to do it now) Follow the steps below. After each step, test if your nextcloud works by restarting apache/fpm with sudo systemctl restart apache2 and optionally sudo systemctl restart php8.2-fpm if you use fpm.

To figure out if you use it, see ernolf’s explanation:

Then visit your nextcloud and test it, again, after each step.

Step 1: Update your system.

sudo apt update && sudo apt upgrade

Step 2: Debug.

A couple things you can do here:

  • Check /var/log/ for files like: php8.2-fpm.log, /apache2/error.log, /apache2/server-error.log, really anything interesting you can find.
  • Check your nextcloud logs, e. g.: /var/www/nextcloud/data/nextcloud.log
  • Check php -v for errors
  • Check sudo -u www-data php /var/www/nextcloud/occ maintenance:repair for errors
  • Add a info.php to your nextcloud install with the following contents:
    <?php
    phpinfo( );
    ?>
    
    Then go to the loaded configuration file, and edit that file, search for error_log and set that to a custom file like /var/log/my_php_errors.log to be sure they are reported.
  • Check wich php packages are installed: dpkg -l | awk '/^ii.*php/ {print $2}'

Now, assuming you find a completely different error, from here, Google and ChatGPT is your best friend. Otherwise:

Step 3.1: Fixing php

You can’t really break anything by reinstalling php, unless you made custom modifications, in which case you should know what you are doing with php (in which case this guide doesn’t really apply). Before reinstalling php, read ahead, there are security issues!

If step 2 suggests a php issue, this would be my first course of action.

There is a couple ways to install php, and I haven’t found a great reason to choose a specific one, that being said, only choose one.
Generally speaking:

  • There are packages with version numbers (like php8.2-gd) and without (like php-gd)
  • Only have either libapache2-mod-php or php-fpm installed. See above on how to find which one your apache is using.
  • Only have one version installed (unless you need more, in which case this doesn’t apply). You can find your version with php -v.
  • There are multiple sources for php. You can use the default, then the version is set, or you can use packages.sury.org/php, also know as ppa:ondrej/php for ubuntu.

Before just removing every php package and installing new ones, disable apache and/or block http traffic through the firewall! If php is gone temporarily, anyone can read your php files, which contain sensitive information like hashes, passwords to your database, your e-mail password etc. Consider using sudo systemctl stop apache2.service.

Now, to prevent the headache resulting in reordering a messed up php installation, remove all php packages with:

sudo apt purge php*

Then, look into /etc/apt/sources.list.d/ to see if you added any other php sources, if you don’t need them (and you probably don’t), remove them. Then update and upgrade your system. Then, install the php stuff with:

sudo apt install -y php php-curl php-cli php-mysql php-gd php-common php-xml php-json php-intl php-pear php-imagick php-dev php-common php-mbstring php-zip php-soap php-bz2 php-bcmath php-gmp php-apcu libmagickcore-dev php-redis php-memcached

Adjust this command for your needs, new requirements, etc.
Finally, reboot.

Step 3.2: Fix unable to load dynamic libary

This is a very specific error, this might not apply to you.
The error:

Unable to load dynamic library 'gd.so' (tried: /usr/lib/php/20220829/gd.so (libx265.so.192: cannot open shared object file: No such file or directory)

For me, this persisted even after completely purging and reinstalling php.
Here, gd.so needs the dynamic libary libx265.so.192, however, I only had lib265.so.199 installed. This is further confirmed looking at ldd (it shows the dependencies of the .so file)

ldd /usr/lib/php/20220829/gd.so | grep "not found"

which returns

libx265.so.192 => not found

For me, it was the easiest option to just create a symlink to the old version:

Find the installed libary:

user@server:/$ sudo apt search libx265
libx265-199/stable,now 3.5-2+b1 amd64  [Installiert,automatisch]
  Codierer für H.265/HEVC-Videostreams (Laufzeitbibliothek)
user@server:/$ sudo find / -name libx265.so.199
/path/to/libx265.so.199

Then symlink:

sudo ln -s /path/to/libx265.so.199 /path/to/libx265.so.192

Finally, restart the server.

I had exactly the same issue on FreeBSD.

If anyone else is in my situation, I fixed it by recompiling specific ports that were throwing the errors. If you check the php modules (php -m) it will tell you what’s stopping php-gd from loading.

There was a missing x265 .c file, so I recompiled x265. I use portmaster, so it’s as easy as portmaster x265. But use portupgrade or whatever you use.

I then got a different error (lib… something) so I recompiled that. Then I got a missing libavcodec .c file error, so I recompiled ffmpeg (libavcodec is part of ffmpeg).

That solved it for me! Everything started working again without even needing to restart the web server. You just need to know where to look for the errors - check php -m and fix what’s broken :slight_smile:

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.