This error typically occurs when the PHP SimpleXML extension is not properly enabled in PHP, even if it's installed on the server. Here's how to resolve this issue:
First, verify SimpleXML installation:
php -m | grep xml
Check PHP configuration:
php -i | grep simplexml
Enable the extension by editing your php.ini
file:
Locate your php.ini
file:
php --ini
Add or uncomment this line in your php.ini
:
extension=php_simplexml.dll ; For Windows
extension=simplexml.so ; For Linux
After making changes:
Restart your web server:
# For Apache on Windows
net stop apache2.4
net start apache2.4
# For IIS
iisreset
If the extension is already enabled but still not working, try these troubleshooting steps:
Check PHP version compatibility
Verify file permissions on the SimpleXML module
Clear PHP's configuration cache
You can also verify the extension is loaded properly in a PHP file:
<?php
if (extension_loaded('simplexml')) {
echo "SimpleXML is loaded!";
} else {
echo "SimpleXML is NOT loaded!";
}
If you're using WHM/cPanel, you can also enable SimpleXML through:
WHM → PHP Extensions
Find SimpleXML in the list
Enable it
Restart PHP