Hi friends i have downloaded the phpQuery plugin from their site . But whenever i try to run the phpQuery demo.php file i get the following error :-
Error:-
Fatal error: Uncaught exception 'Exception' with message
"Old PHP4 DOM XML extension detected. phpQuery won't work until this extension is enabled."
in C:\wamp\www\phpQuery\phpQuery\phpQuery.php:483
Stack trace:
#0 C:\wamp\www\phpQuery\phpQuery\phpQuery.php(271): phpQuery::createDocumentWrapper('<div/>', NULL)
#1 C:\wamp\www\phpQuery\demo.php(11): phpQuery::newDocument('<div/>')
#2 {main} thrown in C:\wamp\www\phpQuery\phpQuery\phpQuery.php on line 483
My php version is 5.2.9-1. What extra extension i need ? Can anyone help me out with this error ??
This error message is misleading. If you look up phpQuery's source, you'll see that it should indeed say the opposite: "phpQuery won't work until this extension is disabled". (Or at least, that's what the source code would lead me to believe, since functions stop to exist when you disable extensions, not when you enable them.)
The reference for this extension on the PHP website is no longer available, but archive.org still has a copy of it. This page tells us that the PHP4 DOM extension's DLL name is php_domxml.dll
, so this is what you need to remove.
In your php.ini file, you need to comment the line where it says extension=php_domxml.dll
. You can make it a comment by prefixing the line with a semicolon.
This all assumes you're not mistaken about your PHP version. I suggest you check a <?php phpinfo(); ?>
to verify that you run the PHP version you're expecting, if you haven't already done so. I find it surprising that a PHP5 install would still use a PHP4 extension.