DOMDocument load

software development

#1

First of all, thanks for reading me. I have this little line

$dom = DOMDocument::load( $file );

here

http://luis-speciale.net/laponie/spip.php?article3

that gives me this

Fatal error: Call to undefined function: load() in /home/.kuddles/lspeciale/luis-speciale.net/laponie/dist/tabexcel.php on line 20

Can someone tell me why ?

Thanks again

Luis


#2

Which version of PHP are you using?

I suspect that the problem you are having is the result of the DOM XML extension not being installed on your instance of PHP on DreamHost.

You can view the output of phpinfo() to see the details, but a look at the PHP Manual DOM XML information states:

" Note: This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.0.0.

Note: This extension is no longer marked experimental. It will, however, never be released with PHP 5, and will only be distributed with PHP 4. If you need DOM XML support with PHP 5 you can use the DOM extension. This domxml extension is not compatible with the DOM extension. "

You might want to try to reset your domain to work with PHP4, and see if it works in that environment. To do this, In the Control Panel -> Domains -> Manage Domains screen, click the “Edit” link under the “Web Hosting” column of the row for your domain, and reset the appropriate Radio Buttons to select PHP4.4.x instead of PHP 5.2.x, and submit the form.

If you feel capable, you can also install your own copy of PHP for use on DreamHost and install whatever extensions you desire.

While there are not specific instruction for installing that particular PECL extension, there are some examples of installing PECL extensions in the DH WIki which might be helpful to you as examples.

–rlparker


#3

Thanks Parker :
I was thinking in this direction (the PHP version). This because in local I’m using PHP 5 and by the time I seted up my server, I did it using 4.2. I did it exactly (the opposite) as you said.

“Control Panel -> Domains -> Manage Domains screen, click “Edit” link under “Web Hosting” and select PHP 5.2.x instead of PHP 4.4.”

And now it works, as you can see (i’ts the blue table, an Excel import) (http://luis-speciale.net/laponie/spip.php?article3&var_mode=calcul)

Again, thank you for your prompt and exhaustive answer.

Cordially

Luis


#4

You are welcome Luis, and I apologize for “reversing” what I was trying to say on the PHP versions. (It was 0244 in the morning for me, and I’m pretty tired :wink: ).

At any rate, I’m really glad you got it working (we were on the right track at least)! All is well that ends well, and the table looks great.

Welcome to DreamHost! :slight_smile:

–rlparker