Do it your self hobby code

Required XMLReader PHP extension is missing on your server!

Required XMLReader Php extension. You are running your own vps and hosting a website. But after you installed a wordpress site, you see this error: Required XMLReader PHP extension is missing on your server!

How to install XMLReader PHP extension on Linux VPS Ubuntu server?

Run this command:

sudo apt-get install php-xml

And then restart Apache:

sudo service apache2 restart

That’s it, you’re done.

Install the right version of XMLReader PHP extension

If it doesn’t work, we need to know what is your php version. Simply type this command:

php --version
return >> PHP 7.1.33

I uses php 7.1 but to make sure what your website php version and configuration, lets write php code on the website root folder.

cd /var/www/html

This is where my website root folder is located. Your’s maybe different

sudo nano php.php

Paste this code:

<?php phpinfo(); ?>

Then save it

Open your website on a browser: https://[yourwebsite]/php.php

As you can see, I have php version 7.0. We have to install the right version of xmlreader

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

To see the changes, refresh you website and find xmlreader: https://[yourwebsite]/php.php

Now that is is installed and enabled, it should work properly.

For additional information, you can enable it if it is disable:

php -i --enable-xml
php -i --enable-xmlreader
php -i --enable-xmlwriter

When you’re done, remember to delete the php.php you written earlier.

Leave a Comment

Your email address will not be published. Required fields are marked *