无法加载动态库' zip' php - ArchLinux

时间:2018-05-16 15:04:29

标签: php archlinux

所以我在 ArchLinux 发行版上安装了 php 7.2.5-2 ,当我运行php时出现此错误:

PHP Warning: PHP Startup: Unable to load dynamic library 'zip' (tried: /usr/lib/php/modules/zip (/usr/lib/php/modules/zip: cannot open shared object file: No such file or directory), /usr/lib/php/modules/zip.so (/usr/lib/php/modules/zip.so: undefined symbol: zip_libzip_version)) in Unknown on line 0

在我的/etc/php/php.ini中,lib被激活:

;extension=xmlrpc
;extension=xsl
extension=zip

lib zip.so存在,但正如错误所说,有一个"未定义的符号"

ls -la /usr/lib/php/modules输出:

-rwxr-xr-x 1 root root  34680 May 10 22:27 bcmath.so
-rwxr-xr-x 1 root root  22704 May 10 22:27 bz2.so
-rwxr-xr-x 1 root root  31704 May 10 22:27 calendar.so
-rwxr-xr-x 1 root root  92016 May 10 22:27 curl.so
-rwxr-xr-x 1 root root  55888 May 10 22:27 dba.so
-rwxr-xr-x 1 root root  83824 May 10 22:27 exif.so
-rwxr-xr-x 1 root root  59248 May 10 22:27 ftp.so
-rwxr-xr-x 1 root root  14192 May 10 22:27 gettext.so
-rwxr-xr-x 1 root root  67440 May 10 22:27 gmp.so
-rwxr-xr-x 1 root root  42928 May 10 22:27 iconv.so
-rwxr-xr-x 1 root root  71536 May 10 22:27 ldap.so
-rwxr-xr-x 1 root root 137152 May 10 22:27 mysqli.so
-rwxr-xr-x 1 root root 436776 May 10 22:27 opcache.so
-rwxr-xr-x 1 root root  26752 May 10 22:27 pdo_mysql.so
-rwxr-xr-x 1 root root  14192 May 10 22:27 shmop.so
-rwxr-xr-x 1 root root 313328 May 10 22:27 soap.so
-rwxr-xr-x 1 root root  92016 May 10 22:27 sockets.so
-rwxr-xr-x 1 root root  14192 May 10 22:27 sysvmsg.so
-rwxr-xr-x 1 root root  10096 May 10 22:27 sysvsem.so
-rwxr-xr-x 1 root root  14192 May 10 22:27 sysvshm.so
-rwxr-xr-x 1 root root  80080 May 10 22:27 xmlrpc.so
-rwxr-xr-x 1 root root  63568 May 10 22:27 zip.so

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

所以我找到了解决方案,我在ArchLinux(downgrader)上安装了sudo pacman -S downgrader并使用它降级了php的版本。

我的猜测是 ziplib 太过"旧"与php版本相比,并且使用 php 7.2.5-2

将天堂更新为英尺