Moodle - Exceção - Chamada para função indefinida xml_parser_create()
Sintomas
A seguinte mensagem de erro ocorre durante a tentativa de atualização do moodle, seja na linha de comando ou no back-end do administrador:
# 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()
!!
Solução
Seu sistema está sem a biblioteca XML do php. Instale um pacote XML php relevante para sua distribuição e versão PHP. Por exemplo, no Ubuntu 16.04 Xenial Xerus com o servidor web Apache executado:
# apt-get install php7.0-xml
# service apache2 restart
Tente novamente a atualização do moodle:
# php moodle/admin/cli/upgrade.php
== Upgrading Moodle database from version 3.1 (Build: 20160523) (2016052300) to 3.1+ (Build: 20160603) (2016052300.02) ==
Your Moodle files have been changed, and you are about to automatically
upgrade your server to this version:
3.1+ (BUILD: 20160603) (2016052300.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 ++