4

Call to undefined function simplexml_load_string()

I am getting this error on all the sites located on our server. Everything was working correctly until today and all of sudden this error poped up.

I have checked Simplexml and it is already installed on the server. Here is the error:

Fatal error: Call to undefined function simplexml_load_string() in .../lib/Varien/Simplexml/Config.php on line 510

Tom
  • 906
  • 1
  • 8
  • 30
Karan S
  • 55
  • 1
  • 1
  • 5
  • Same thing happened to me, today also. Yesterday everything was fine. – Tom May 17 '17 at 16:41
  • Some more troubleshooting is showing the following: When i go in the command line and enter php -m i can see SimpleXML in the list. However if I create a file on my server, and try extension_loaded("SimpleXML") it returns false – Tom May 17 '17 at 17:42
  • This is some XML file error. Please check the resend changed XML file. – Jenith Samuel May 18 '17 at 13:06

3 Answers3

0

Had the same problem today. I tried to check whether extension is loaded and I was getting true (from command line) Then I found that I was using multiple php versions and the site in question was using php5.4 which for some reason was failing for simplexml

Since I am in a cPanel/WHM environment I ran

yum install ea-php54-php-simplexml

which fixed the issue. This is for EasyApache4. Perhaps you can just update simplexml sepending on your flavour of linux.

Shardon
  • 585
  • 5
  • 17
  • When I tried yum install ea-php-70-php-simplexml it says: Package ea-php70-php-xml-7.0.19-3.3.1.cpanel.x86_64 already installed and latest version Nothing to do Any thoughts? Also any idea why so many people have the same problem the same day? – Tom May 18 '17 at 16:14
  • is it possible that you are not using php 7 for this specific site? cPanel and php56+ allows for multiple php installations together. My issue was that the site in question was using php 5.4 so I needed to do yum install ea-php54.... etc As per the question of the same day problem, I guess it has to do with cPanel updates – Shardon May 19 '17 at 09:06
  • I only have php 7 enabled for the entire server and no other version active – Tom May 19 '17 at 10:41
0

Installing latest extension resolved the issue.

yum install ea-php56-php-simplexml

0

It may be late, but for future readres.
I had almost the same issue, the problem was that, in console, the php.ini file path was different from the php.ini path for web pages that served from apache.

Since you said with php -m i you can see SimpleXML. maybe you need to edit different ini file.
You can create a php file with content of <?php phpinfo(); and chack Loaded Configuration File value to make sure if you are editing the right file.

if you need to install SimpleXML read this.

Mohammad Salehi
  • 565
  • 1
  • 12
  • 33