Missing XMLReader in my PHP version?
Asked Answered
B

4

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!

Bandit answered 19/4, 2012 at 9:54 Comment(2)
check phpinfo() if it is activated or not in the ini fileDollydolman
aah i see, did not know that you need to enable an extension before you can use it (first time user, :)), thanks!Bandit
U
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.

Universal answered 19/4, 2012 at 9:58 Comment(2)
so i'm using Fedora 12, how can I enable this? I saw in the results of phpinfo() --disable-xmlreader, it seems that it is not installed.Bandit
yes, it could be php53-xml or php-xml on different distros.Universal
P
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
Puparium answered 30/10, 2019 at 17:35 Comment(0)
C
2

run php -m to check if the module is present

Cocaine answered 19/4, 2012 at 9:59 Comment(1)
only a module called 'xml' is present, so i guess it's not. what can i do? thanks!Bandit
M
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.

Mandiemandingo answered 21/9, 2021 at 13:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.