PHP 警告:PHP 启动:无法加载动态库

2021-12-29 00:00:00 php zend-framework

当我运行这个命令时 php -v
出现此错误:

When I run this command php -v
this error comes up:

PHP 警告:PHP 启动:无法加载动态库 '/usr/lib/php/20160303/dom.so' -/usr/lib/php/20160303/dom.so:未定义符号:php_libxml_node_free_list in Unknown on line0

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/dom.so' - /usr/lib/php/20160303/dom.so: undefined symbol: php_libxml_node_free_list in Unknown on line 0

PHP 警告:PHP 启动:无法加载动态库 '/usr/lib/php/20160303/xmlreader.so' -/usr/lib/php/20160303/xmlreader.so:未定义符号:dom_node_class_entry in Unknown on line0

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xmlreader.so' - /usr/lib/php/20160303/xmlreader.so: undefined symbol: dom_node_class_entry in Unknown on line 0

PHP 警告:PHP 启动:无法加载动态库 '/usr/lib/php/20160303/xsl.so' -/usr/lib/php/20160303/xsl.so:未定义符号:dom_node_class_entry in Unknown on line0
PHP 7.1.5-1+deb.sury.org~trusty+2 (cli) (build: May 22 2017 13:39:01) ( NTS )

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xsl.so' - /usr/lib/php/20160303/xsl.so: undefined symbol: dom_node_class_entry in Unknown on line 0
PHP 7.1.5-1+deb.sury.org~trusty+2 (cli) (built: May 22 2017 13:39:01) ( NTS )

版权 (c) 1997-2017 PHP GroupZend Engine v3.1.0,版权所有 (c) 1998-2017 Zend Technologies使用 Zend OPcache v7.1.7-1+ubuntu14.04.1+deb.sury.org+1,版权所有 (c) 1999-2017,由 Zend Technologies 提供

Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.7-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

推荐答案

安全的解决方案是重新安装所有php7相关的包.

Safe solution is to reinstall all php7 related packages.

您只需在控制台输入此命令即可:

You can do it by simply entering this command to console:

sudo apt-get install --reinstall `dpkg -l | grep 'ii  php7' | awk '{ printf($2" "); next}'`

此解决方案将保持您的配置不变

This solution will keep your configuration unchanged

相关文章