[Wordpress/PHP7.1] Enable XMLReader on CentOS 7

  • このエントリーをはてなブックマークに追加


I have installed the latest Wordpress and PHP7.1 in CentOS7 and downloaded the theme like Customify and Astra. The theme provides us the initial import data as sample data but I couldn't set up them after clicking the import button.

In the case of Customify

After clicking the "start import" button, the loading keeps forever.


In the case of Astra

The following error shows up on the modal.

Starter Templates import requires XMLReader extension to be installed. Please contact your web hosting provider and ask them to install and activate the XMLReader PHP extension.


What I installed PHP 7.1

I executed this command.

yum install --enablerepo=remi,remi-php71 php php-devel php-mbstring php-mysqlnd php-pdo php-gd

ネコでもわかる!さくらのVPS講座 ~第四回「phpとMariaDBをインストールしよう」

Why this Error happened?

This error causes that I didn't install the "xmlreader" in PHP7.1.

How to solve

  1. Run this command.

    yum --enablerepo=remi,remi-php71 install php-xml

  2. Restart the server.

    systemctl restart httpd.service


It might not fix this issue if you run yum php-xml. In your server, the default version of PHP might be 5.4 like me even if you installed PHP7.1. You need to install php-xml in PHP7.1(in my case.), Otherwise, the following error happens to you.

Error: Package: php-xml-5.4.45-18.el7.remi.x86_64 (remi)

How to Install php-xml in CentOs

  • このエントリーをはてなブックマークに追加