I was trying to import the sample data provided with a ThemeForest theme to my client’s WordPress website and failing. Initially I thought it’s a file permission issue but even after changing file permission to 0755 and eventually to 0777 didn’t improve the situation. Suddenly I realized file permission issue is sorted and the current issue is server not having PHP DOM installed!
What is DOM?
As per Wikipedia… “The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.”
And as per w3.org… “The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page.”
What is PHP DOM extension?
According to PHP.Net… “The DOM extension allows you to operate on XML documents through the DOM API with PHP 5.”
Installing the PHP DOM Extension on CentOS
You’ll either superuser or root privileges…
[bash] sudo yum install php-xml [/bash]
or…
[bash] yum install php-xml [/bash]
Make sure to restart Apache for installation to take effect…
[bash] service httpd restart [/bash]
Check whether DOM is installed correctly
Create a PHP file with following code…
[php] <?php phpinfo(); ?> [/php]
Check the output of the file in a web browser.
Leave a Reply