Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Apache2, php5 and domxml support

How to enable domxml support on apache2/php5?



10:02 am on Feb 5, 2007 (gmt 0)

10+ Year Member


I'm running a local apache2 server on my ubuntu. I need the PHP DOM XML functions to work, but there seems to be no domxml support for my Apache2.

Apache Version Apache/2.0.55 (Ubuntu) PHP/5.1.2
Loaded core mod_access mod_auth mod_log_config mod_logio mod_env mod_setenvif prefork http_core mod_mime mod_status mod_autoindex mod_negotiation mod_dir mod_alias mod_so mod_cgi mod_php5 mod_rewrite mod_userdir
dom ---------
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.24
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled

libxml ---------
libXML support active
libXML Version 2.6.24
libXML streams enabled

So, using a PHP function like domxml_open_file() should work. But it does not. I've got a message saying there's no such a function. I've tried the deprecated "xmldocfile()", but here again, no way to.

I've installed through synaptic the "XMLv2 module for php4", as there seems to be no equivalent for PHP5, but still no domxml support.

I also have a remote hosting. Everything is enabled the same way, and same error message. The phpinfo() shows that the server is "--dom-disabled". I've asked my hosting company to enable it. I guess that will work afterwards. My local server -I suppose- uses mod_so to load this module. I *may* have to set a loadModule directive somewhere, but where?




2:55 pm on Feb 10, 2007 (gmt 0)

10+ Year Member

This is a PHP5 issue, not apache. There domxml functions have been removed in php5. php5 is much better at xml - take a look at the online documentation for more information.

If you are using legacy code that needs to use the domxml functions then you can still install a pecl package to make this possible. Since you are using ubuntu this is not too hard :-)

apt-get install php5-dev php-pear
pecl install domxml


8:41 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Exactly, sabai.

The DOM extension allows you to operate on XML documents through the DOM API with PHP 5. For PHP 4, use DOM XML.

DOM Functions [php.net]


Featured Threads

Hot Threads This Week

Hot Threads This Month