Moodle:Exception - Call to undefined function xml_parser_create()

解决方案

系统缺少PHP XML库。 安装XML库。
例如,在Ubuntu 16.04 Xenial Xerus上 :

# apt-get install php7.0-xml
# service apache2 restart

重新尝试Moodle升级:

# php moodle/admin/cli/upgrade.php 
== Upgrading Moodle database from version 3.1 (Build: 20140523) (2014052300) to 3.1+ (Build: 20140603) (2014052300.02) ==
Your Moodle files have been changed, and you are about to automatically
upgrade your server to this version:
3.1+ (BUILD: 20140603) (2014052300.02)
Once you do this you can not go back again. Please note that this process
can take a long time.
Are you sure you want to upgrade this server to this version?
type y (means yes) or n (means no)
: y
-->System
++ Success ++

问题

在升级Moodle时发生以下错误消息:

# php moodle/admin/cli/upgrade.php 
Default exception handler: Exception - Call to undefined function xml_parser_create() Debug: 
Error code: generalexceptionmessage
* line 76 of /lib/xmlize.php: Error thrown
* line 307 of /lib/environmentlib.php: call to xmlize()
* line 355 of /lib/environmentlib.php: call to load_environment_xml()
* line 101 of /lib/environmentlib.php: call to get_latest_version_available()
* line 116 of /admin/cli/upgrade.php: call to check_moodle_environment()
!!! Exception - Call to undefined function xml_parser_create() !!!
!! 
Error code: generalexceptionmessage !!
!! Stack trace: * line 76 of /lib/xmlize.php: Error thrown
* line 307 of /lib/environmentlib.php: call to xmlize()
* line 355 of /lib/environmentlib.php: call to load_environment_xml()
* line 101 of /lib/environmentlib.php: call to get_latest_version_available()
* line 116 of /admin/cli/upgrade.php: call to check_moodle_environment()
 !!
日期:2020-07-07 20:54:47 来源:oir作者:oir