Call to undefined function: domxml_open_file()

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm using PHP 4.3.9 with Apache 2.0, and keep getting the error

"[client] PHP Fatal error:  Call to undefined function:
domxml_open_file() in /var/www/html/php/domtest.php on line 8"   (from
the Apache error log).

Here's the page itself:-

   $foo = domxml_open_file("test.xml");

Calling domxml_new_doc() instead fails similarly.

I've checked the version of libxml2 (, which should
work; the PHP docs mention "libxml", not "libxml2", but references
elsewhere imply that they meant libxml2). I'm running the whole
caboodle under Fedora Core 3 Linux.

(And yes, I know that DOM XML is deprecated; but (a) I'm running PHP4,
not 5, and more importantly (b) The person I'm developing for wants it
to run under PHP4).

Perhaps I've missed something particularly obvious, but this is really
doing my head in, and I'd appreciate some pointers. Thanks!

- MS

Re: Call to undefined function: domxml_open_file()

Quoted text here. Click to load it

The extension you are trying to use is not configured or not installed.

Quoted text here. Click to load it

In order to run an extension, you need (path names are
for FreeBSD, yours may vary for Linux):
    (a) The extension PHP module (in this case,  
        in /usr/local/lib/php/20020429/
    (b) A line in /usr/local/etc/php/extensions.ini containing
        a line for the extension:
        and it must not have a semicolon in front of it.
    (c) Any library/libraries required by the extension, in
        this case: /usr/local/lib/

After you have fixed any of these, stop and restart Apache.

Quoted text here. Click to load it

                        Gordon L. Burditt

Re: Call to undefined function: domxml_open_file()

Whilst your setup seems to be somewhat different from mine (I'm
actually in the process of learning FreeBSD, but still don't know
enough to use it for development); e.g. I don't have extensions.ini,
although there seems to be  a section in php.ini to do the same thing;
basically, though, you hit the nail on the head:-

I had to install the **** thing... the RPM was even on the FC3 install
disks. Can't believe I wasted so much time over it >:-(

Two things threw me; firstly that phpinfo() indicated that it had been
compiled with domxml support, and the documentation seemed to imply
that this extension should be included as standard in PHP4. Perhaps I
misparsed it. Who knows....  

Anyway, thanks!

- MS

Site Timeline