DOM in php 4, trouble when running page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thatotherguy
Forum Newbie
Posts: 3
Joined: Sun May 21, 2006 2:13 pm

DOM in php 4, trouble when running page

Post by thatotherguy »

I'm writing some code that writes and update an xml document. I've gotten the code working on the command line, but now that I'm trying to run it by accessing it through the internet, it's failing with the following error message:

Fatal error: Call to undefined function: domxml_open_file()

When I run the code on the command line (on the server... in the same directory... ) it works fine. When I try to access it via the web, it doesnt seem to 'see' the dom functions. Is this just my server flunking out on me, or is there something I can do to make this work?


Thanks
santosj
Forum Contributor
Posts: 157
Joined: Sat Apr 29, 2006 7:06 pm

Post by santosj »

What version of PHP 4 do you have?

It says that it is a PHP 4.2.1 and above function.

Also try if you are using PHP 4.3 and above.

Code: Select all

$dom = domxml_open_file($file, DOMXML_LOAD_PARSING, $error);

if(is_array($error)) print_r($error);
thatotherguy
Forum Newbie
Posts: 3
Joined: Sun May 21, 2006 2:13 pm

Post by thatotherguy »

Thanks for your reply.


Well, it's apparently php 4.1.2 however, it runs fine from the command line, ie:

php index.php

produces the desired output. But the error shows up when I access it from the web. I don't really understand, but I'm guessing it's just something I can't do anything about (there's no way I'll be able to install or change anything on this server). Is there any library that might do what I want? At the very least, I can see if they have it installed.


Thanks
santosj
Forum Contributor
Posts: 157
Joined: Sat Apr 29, 2006 7:06 pm

Post by santosj »

Well, is the file and XML being written or is just no error being returned?
thatotherguy
Forum Newbie
Posts: 3
Joined: Sun May 21, 2006 2:13 pm

Post by thatotherguy »

It works fine when I run it on the command line -- file written, xml updated. [/list]
Post Reply