[solved] php: unable to load "apcu" and "imagick"

Problems with packages? Post here, using [tags] of the package name.

[solved] php: unable to load "apcu" and "imagick"

Postby UomoInvisibile » Fri May 24, 2024 4:13 pm

After updating php to version "8.3.7-2" and php-legacy to version "8.2.19-2", the php-apcu/php-legacy-apcu and php-imagick/php-legacy-imagick modules fail to load due to "undefined symbol php_strlcpy". The error message for apcu.so reads:

[code]
PHP Warning: PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib/php/modules/apcu.so (/usr/lib/php/modules/apcu.so: undefined symbol: php_strlcpy)) in Unknown on line 0
[/code]

I use the two mentioned packages with nextcloud - with php-legacy "8.2.19-1" everything was fine.

Has anyone else run into this and fixed it?
Last edited by UomoInvisibile on Sat Jun 01, 2024 9:15 am, edited 1 time in total.
UomoInvisibile
 
Posts: 2
Joined: Fri May 24, 2024 6:13 am

Re: php: unable to load "apcu" and "imagick"

Postby Musikolo » Sat May 25, 2024 11:48 am

Hi,

I got a very similar issue. Today, after upgrading my system (pacman -Syu), 'nextcloud' stopped working and 'occ upgrade' returned this error:

[code]
[root@MyBox ~]# occ upgrade
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/lib/php-legacy/modules/imagick (/usr/lib/php-legacy/modules/imagick: cannot open shared object file: No such file or directory), /usr/lib/php-legacy/modules/imagick.so (/usr/lib/php-legacy/modules/imagick.so: undefined symbol: php_strlcpy)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'apcu' (tried: /usr/lib/php-legacy/modules/apcu (/usr/lib/php-legacy/modules/apcu: cannot open shared object file: No such file or directory), /usr/lib/php-legacy/modules/apcu.so (/usr/lib/php-legacy/modules/apcu.so: undefined symbol: php_strlcpy)) 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?)
[root@MyBox ~]#
[/code]

I checked the php-legacy packages I had in '/var/cache/pacman/pkg', and this is what I found:
[code]
[musikolo@MyBox pkg]$ ls -ltr php-legacy*
-rw-r--r-- 1 root root 103928 Mar 3 17:29 php-legacy-imagick-3.7.0-8-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 566 Mar 3 17:29 php-legacy-imagick-3.7.0-8-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 50188 Mar 3 18:37 php-legacy-apcu-5.1.23-3-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 566 Mar 3 18:37 php-legacy-apcu-5.1.23-3-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 4226844 May 7 12:01 php-legacy-8.2.19-1-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 2583016 May 7 12:02 php-legacy-fpm-8.2.19-1-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 27072 May 7 12:02 php-legacy-gd-8.2.19-1-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 566 May 7 12:02 php-legacy-gd-8.2.19-1-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 566 May 7 12:02 php-legacy-fpm-8.2.19-1-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 566 May 7 12:02 php-legacy-8.2.19-1-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 4280804 May 20 00:02 php-legacy-8.2.19-2-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 2595512 May 20 00:03 php-legacy-fpm-8.2.19-2-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 27228 May 20 00:03 php-legacy-gd-8.2.19-2-aarch64.pkg.tar.xz
-rw-r--r-- 1 root root 566 May 20 00:03 php-legacy-8.2.19-2-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 566 May 20 00:03 php-legacy-gd-8.2.19-2-aarch64.pkg.tar.xz.sig
-rw-r--r-- 1 root root 566 May 20 00:03 php-legacy-fpm-8.2.19-2-aarch64.pkg.tar.xz.sig
[musikolo@MyBox pkg]$
[/code]

I downgraded all new 8.2.19-2 packages back to 8.2.19-1, and that solved the issue on both occ and nexcloud. I noticed the php-legacy-imagick and php-legacy-apcu packages didn't get an update in quite a long time, so I wonder whether rebuilding those might address this issue.

Currently using the following php-legacy pckages:
[list]
- php-legacy-8.2.19-1
- php-legacy-apcu-5.1.23-3
- php-legacy-fpm-8.2.19-1
- php-legacy-gd-8.2.19-1
- php-legacy-imagick-3.7.0-8
[/list]

I hope that helps address the issue.

Thanks.
Musikolo
 
Posts: 28
Joined: Fri Jul 25, 2014 3:56 am

Re: php: unable to load "apcu" and "imagick"

Postby archtom » Sun May 26, 2024 2:37 pm

Hey,

thanks for posting, I am having the same issue. After some research all I found was that rebuilding the packages should solve the problem.

Thanks to the developers, please take care of this.
archtom
 
Posts: 1
Joined: Sun May 26, 2024 2:33 pm

Re: php: unable to load "apcu" and "imagick"

Postby Schrekkorr » Sun May 26, 2024 7:41 pm

Same Problem here. Any other workaround than rebuild official packages on your own?
Schrekkorr
 
Posts: 2
Joined: Wed Jan 05, 2022 4:14 pm

Re: php: unable to load "apcu" and "imagick"

Postby CaptainRage » Sun May 26, 2024 9:20 pm

I also got the same error pertaining to php-legacy-imagick when upgrading. In general the upgrade to Nextcloud 29 seems to have been successful. Nextcloud starts but when I try to access a photo file through the browser it wants to download the file instead of displaying it (strange behavior) and it refuses to open anything when pressing "Help" (maybe because php-legacy-imagick is not working)? I assume the developers will have to rebuild the relevant packages in order to link the libraries properly.
CaptainRage
 
Posts: 19
Joined: Fri Mar 15, 2013 3:56 pm

Re: php: unable to load "apcu" and "imagick"

Postby unifai » Mon May 27, 2024 7:06 pm

Rebuilding php-apcu and php-imagick fixed it for me, you can just clone the official git repos from:
- [url]https://gitlab.archlinux.org/archlinux/packaging/packages/php-imagick[/url]
- [url]https://gitlab.archlinux.org/archlinux/packaging/packages/php-apcu[/url]

edit the PKGBUILDs to replace the arch by your arch and run [code]makepkg -s[/code] in them

after that, you can install the corresponding packages either legacy or not or both with [code]pacman -U[/code]
unifai
 
Posts: 1
Joined: Mon May 27, 2024 7:01 pm

Re: php: unable to load "apcu" and "imagick"

Postby Schrekkorr » Mon May 27, 2024 9:11 pm

I don't get a php-legacy-imagick tarball (check() failed), I only get php-imagick. php-legacy-apcu works fine. This is enough for nextcloud to run the "sudo occ upgrade"-command. :-)
Schrekkorr
 
Posts: 2
Joined: Wed Jan 05, 2022 4:14 pm

Re: php: unable to load "apcu" and "imagick"

Postby UomoInvisibile » Tue May 28, 2024 4:38 am

[quote="unifai"]Rebuilding php-apcu and php-imagick fixed it for me...[/quote]

It's always a problem when you have absolutely no idea (like me). So, thank you very much, unifai - your solution worked (for me) like a charm.
UomoInvisibile
 
Posts: 2
Joined: Fri May 24, 2024 6:13 am

Re: php: unable to load "apcu" and "imagick"

Postby Musikolo » Sat Jun 01, 2024 1:44 am

Looks like package rebuilds on 5/29 for php-legacy-apcu & php-legacy-imagick sorted the issue out to me. Maybe it's time to mark this issue as "solved".

Thanks!
Musikolo
 
Posts: 28
Joined: Fri Jul 25, 2014 3:56 am


Return to Packages

Who is online

Users browsing this forum: ntova and 11 guests