12

I'm trying to use the WURFL API for PHP. I'm getting the following error during its initialization.

Fatal error: Class 'XMLReader' not found in /var/www/html/wurfl-api/WURFL/Xml/AbstractIterator.php on line 89

my version of PHP when I run php -v:

PHP 5.3.3 (cli) (built: Jul 22 2010 16:21:30) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Why do you think I am getting this error? Is my version of PHP outdated?

Thank you!

ultrajohn
  • 2,527
  • 4
  • 31
  • 56

4 Answers4

9

You have no XML extention installed. In RedHat like systems type yum install php53-xml in terminal. Or you can simply add phpinfo(); to your PHP code to rewiew your server configuration and find wether XML installed or not.

s.webbandit
  • 16,332
  • 16
  • 58
  • 82
9

To install in debian based systems.

sudo apt install php7.2-xml

of course replace the php version with the version you are using.

You can check current used php version with :

php -v

After it is installed you will need to restart apache service if you are using it, or nginx.

sudo service apache2 restart
Goddard
  • 2,863
  • 31
  • 37
2

run php -m to check if the module is present

Edson Medina
  • 9,862
  • 3
  • 40
  • 51
0

I've had this error while running the artisan command which reads files from excel on the development server via PuTTY.

And the solution is to change the excel extension from xlsx to xls.

Hana Hasanah
  • 145
  • 1
  • 6