[resolved] Cannot instantiate non-existent class domxml |
|
After reading this post:
php-extension-not-picked-up-in-debug-sessions-t320.html and installing all .dlls, I'm still having this error: Fatal error: Cannot instantiate non-existent class: domxml_new_doc in c:\...\file.php on line 26 Line 26 would be this one: $dom = new domxml_new_doc('1.0'); I've also tryed running this: <?php header('Content-type: text/xml'); $x_doc = new domxml_new_doc('1.0'); $x_root = $x_doc->create_element('TEST'); $x_doc->append_child($x_root); print $x_doc->dump_mem(false); ?> With "new", I get the following error: <b>Fatal error</b>: Cannot instantiate non-existent class: domxml_new_doc <?php header('Content-type: text/xml'); $x_doc = domxml_new_doc('1.0'); $x_root = $x_doc->create_element('TEST'); $x_doc->append_child($x_root); print $x_doc->dump_mem(false); ?> Without "new", the following: <b>Fatal error</b>: Call to undefined function: domxml_new_doc() Any ideas? |
||||||||||||
|
|
This is only one reason of this fault, you haven't installed DOM XML Functions.
I guess you have server under Windows. In this case, check next. 1) If you use PHP4, check that you have php_domxml.dll in your extension folder, and you have this included in php.ini, i.e. you have to have line: extension=php_domxml.dll in your php.ini file (without semicolumn symbol at start of line, because it's comment symbol). You can also create test script with next code:
Then run it and check if DOM XML really installed. 2) If you use PHP5, it's another story... Because it's don't support DOM XML, and there isn't bundled .dll with PHP5, because it have class model for working with XML/HTML documents. http://www.php.net/manual/ru/book.domxml.php It's included in core of PHP5, as I remember. |
||||||||||||||
|
|
Thank you so much for answering, and I'm sorry for the lack of information on previous post.
I'm running PHP Version 4.2.3 under Windows XP. I have libxml2.dll and php_domxml.dll both at extension and windows32 folders. I run phpinfo() test to check if I'm editing the correct php.ini file, and yes, I am. In it, I have: extension=php_domxml.dll And just added: extension=libxml2.dll And I still get this error: Fatal error: Cannot instantiate non-existent class: domxml_new_doc When I run phpinfo(), I see nothing related to DOM XML. Closer thing to it is: xml XML Support active XML Namespace Support active EXPAT Version 1.95.2 Any ideas on what am I doing wrong?
|
||||||||||||||||
|
Guru master
|
Why do you call it like a function? DOMDocument is a class...
|
||||||||||||||
|
|
"First, check your configuration or try initializing a DOMDocument() to determine if your server's PHP has DOM functionality on. If you do have access to the DOM, you can use it to create XML nodes, append child nodes, and output an XML document. Since KML is an XML markup language, this works for KML as well. If DOM is not available on your server, try using either the dom_xml or echo method " I wrote the script with using dom_xml, so I could run it in a PHP 4 server. I tried running $oDOM = new DOMDocument ( '1.0', 'UTF-8' ); as you explained, and there were no errors. I think what I'm gonna do is rewrite the whole script with PHP 5 DOM function, instead of dom_xml, and upgrade my server from PHP 4 to 5 and see if it works. Thanks. |
||||||||||||||||
|
|
Can't believe!!!!!!!!!! It's working!!!!!!!!!!
Thanks guys! I couldn't run it with dom_xml @ PHP 4, but it worked using PHP 5 and DOM function... Don't ask me why, it just did. I'm kinda happy right now |
||||||||||||
|
[resolved] Cannot instantiate non-existent class domxml |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by