Call to undefined function xml_parser_create()

Hey there folks.

I’m running into an issue with a brand new install (local) where I’m getting errors for xml_parser_create.

In Wordpress, having Jetpack installed, I was getting this error: PHP Fatal error: Call to undefined function xml_parser_create() in /var/www/html/wp-includes/class-IXR.php on line 264

Removing Wordpress from the equation, I created a file called parse.php and just had these lines:

<?php
$xml_parser = xml_parser_create("");
print $xml_parser;
?>

This gives me the error:

( ! ) Fatal error: Uncaught Error: Call to undefined function xml_parser_create() in /srv/www/caltonnutrition.com/current/web/parse.php on line 2
( ! ) Error: Call to undefined function xml_parser_create() in /srv/www/caltonnutrition.com/current/web/parse.php on line 2

Upon googling further, it appears that this happens the XML extension of PHP is not properly installed.

I added to roles/php/main.yml:

- name: Install PHP 7.0
  apt:
    name: "{{ item }}"
    state: present
    force: yes
  with_items:
  - php7.0-xmlrpc

in hopes that it would work, but alas it hasn’t.

I’ve gone and reinstalled vagrant three or four times just to make sure I’m not doing something wrong.

Further debugging in making a php file with just phpinfo(); shows that /etc/php/7.0/fpm/conf.d/20-xmlrpc.ini is being loaded as you can see here: http://i.imgur.com/vHppwCk.png

XML rpc has nothing to do with Xml parsing. Make sure php7.0-xml is installed.

php7.0-xml needs to be in trellis by default if it’s not already.

1 Like

That was the fix. Thank you @austin . Submitting a PR now.