即使带有 zz 前缀,也无法加载 mailparse

即使带有 zz 前缀,也无法加载 mailparse

我已阅读过许多文章,指出 mailparse 需要在 mbstring 之后加载,但是,即使在 mailparse 前面加上 zz,仍然会出现同样的问题,而我真的绞尽脑汁想找出原因。

尽管我仍然在模块列表中看到它。

[root@intranet:~]# php -m
PHP Warning:  PHP Startup: Unable to load dynamic library     '/usr/lib64/php/modules/zz-mailparse.so' - /usr/lib64/php/modules/zz-    mailparse.so: undefined symbol: mbfl_convert_filter_flush in Unknown on line 0
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
libxml
mailparse
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

/etc/php.ini

extension=zz-mailparse.so

尽管我允许使用 SSELinux,但我不确定这是否是问题所在。

[root@intranet:/usr/lib64/php/modules]# ls -lhZ
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       bz2.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       calendar.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       ctype.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       curl.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       dom.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       exif.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       fileinfo.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       ftp.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       gd.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       gettext.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       gmp.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       iconv.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       imap.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       intl.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       json.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       mbstring.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       mcrypt.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       mysqli.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       mysql.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       opcache.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       pdo_mysql.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       pdo.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       pdo_sqlite.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       phar.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       shmop.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       simplexml.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       sockets.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       sqlite3.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       tokenizer.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       wddx.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       xmlreader.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       xml.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       xmlwriter.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       xsl.so
-rwxr-xr-x. root root system_u:object_r:lib_t:s0       zip.so
-rwxr-xr-x. root root unconfined_u:object_r:lib_t:s0   zz-mailparse.so

我在一台装有 PHP 5.6.28 和 MariaDB 5.5.52 的 RHEL7 服务器上

答案1

也许你两次引入了该模块。类似于:

$ /etc/php/7.1/cli/conf.d # ls -lh | grep parse
lrwxrwxrwx 1 root root 41 Feb  7 12:37 20-mailparse.ini -> /etc/php/7.1/mods-available/mailparse.ini
lrwxrwxrwx 1 root root 41 Feb  7 13:03 21-mailparse.ini -> /etc/php/7.1/mods-available/mailparse.ini

答案2

我在这里遇到了同样的问题。

该问题是由两个事实引起的:

  1. PHPmailparse.so动态链接库需要mbstring.soPHP动态链接库。

  2. /etc/php.iniPHP 动态链接库(“扩展”)从(和/etc/php-cli.ini)加载/etc/php.d目录中的文件按字母顺序

有几种解决方案:

  1. 确保在mbstring.so之前已加载:mailparse.sophp-cli.ini
extension=mbstring.so
extension=mailparse.so
  1. 如果 中的文件中含有任一扩展名/etc/php.d,请重命名.ini文件本身以使其有序。
mbstring.so

    extension=mbstring.so

zz-mailparse.so

    extension=mailparse.so
  1. 加载mbstring.so模块两次。请注意,这会在日志中产生大量我不喜欢的 PHP 警告。
mailparse.so

    extension=mbstring.so
    extension=mailparse.so

mbstring.so

    extension=mbstring.so

相关内容