NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP extension not picked up in debug sessions


Joined: 22 Dec 2003
Posts: 4
Location: Halifax, UK
Reply with quote
Hi,

I've been posting the following problem in the Maguma forum pages; perhaps someone here knows the answer?

I have a page that I can view OK in a browser. It uses the DOM extension. When I try to debug it I get the following error in the log: "PHP Fatal error: Cannot instantiate non-existent class: domxml_new_doc . . ."

I've tried various things to get this working - stuck a copy of php.ini in the directory where php.exe lives, tried running PHP as CGI instead of a module, copied all DLLs and extensions to c:\win98 (this is a Windows 98 PC) and c:\win98\system. No joy. Any ideas?

_________________
===================
If you've got a good excuse,
don't use it
===================
View user's profileFind all posts by cow133Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
run phpinfo() and make surre libxml is loaded. Otherwise you can't instantiate any classes provided by this extension.
If it is not loaded, you may want to enable logging and check your settings. Also, make sure that php.ini you work with is the same as in the phpinfo(). It's a common trap when one edits a different php.ini than php actually uses.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Dec 2003
Posts: 4
Location: Halifax, UK
Reply with quote
I've run the following code from my server and in Maguma: $iniloc = get_cfg_var('cfg_file_path'); print $iniloc;. In both I get the answer "C:\win95\php.ini" (this is a Windows98 machine upgraded from Win95 a long time ago. latest service packs and MDC before you ask).

I can run scripts in my browser that use domxml.dll, and that line is present in c:\win95\php.ini, and a call to phpinfo() in the browser also confirms that domxml is loaded. But the second I try to use Maguma and the debugger I lose domxml (even though the code above insists that c:\win95\php.ini is in use, and the domxml extension is definitely enabled in that file).

Perhaps you can suggest some further test that will tell me whether c:\win95\php.ini is being used at all by the debugger, or if all the extensions are being ignored, or perhaps it's just domxml?

I'm posting this to the studio forum over at Maguma too - perhaps between you you guys might suss it?

_________________
===================
If you've got a good excuse,
don't use it
===================
View user's profileFind all posts by cow133Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
I don't know what Maguma does with php and how it loads the engine.
Try to run phpinfo() in the debugger *using* the IDE and make sure that everything is in place.
If nothing helps, I'd recommend you try out a different IDE.
As I know DBG has no problem with domxml/libxml.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Dec 2003
Posts: 4
Location: Halifax, UK
Reply with quote
I should apologise - I've found that actually domxl just isn't working at all. As you said earlier, I haven't got libxml installed. In case anyone else is making a similar fool of themselves, I'll just itemise the things I learned from this:

1) the fact that phpinfo() tells you that domxml is enabled doesn't mean that it works, even when it has the libxml number. Enabling iconv doesn't help either, and the reportedly active xml is not.
2) try this if in doubt whch ini file is in use-
Code:
$iniloc = get_cfg_var('cfg_file_path');
print $iniloc;

3) run this to see if domxml is _really_ working:
Code:
<?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);
?>


Still haven't worked out how to get domxml going on Windows. I could have sworn I had it working before, but I think that was because of Sablotron, which I later uninstalled.

(posted in Maguma Studio forum too)

_________________
===================
If you've got a good excuse,
don't use it
===================
View user's profileFind all posts by cow133Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
Have you tried domxml shipped with NuSphere phped ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Dec 2003
Posts: 4
Location: Halifax, UK
Reply with quote
Argh! Got it. My fault, of course. Everything kept breaking down at the line
Code:
$x_root = new $x_doc->create_element('TEST');

Take out the word 'new' and it works, as many could have told me. Embarassed

I'll have another go at the debugger now. Thanks for your help.
View user's profileFind all posts by cow133Send private message
PHP extension not picked up in debug sessions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic