php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38206 DOMXML bnot available when running from command line
Submitted: 2006-07-25 10:19 UTC Modified: 2006-07-25 10:40 UTC
From: tommi dot korhonen at iki dot fi Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.4.2 OS: Windows XP
Private report: No CVE-ID: None
 [2006-07-25 10:19 UTC] tommi dot korhonen at iki dot fi
Description:
------------
When running a script from command line (eg. c:\php\cli\php.exe domxml.php) the DOMXML functions don't work. I get error message
Fatal error: Call to undefined function: domxml_open_file() in C:\temp\domxml.php on line 4 
All needed dlls should be available, since DOMXML works fine when running on web server (Apache2, PHP as CGI). DOMXML extension is also reported available in phpinfo() on web server but not in cli\php.exe -i

Reproduce code:
---------------
<?php
$in = file_get_contents($argv[1]);
// create XML-DOM object from a file
if (!$dom = domxml_open_file($in)) {
   exit("Couldn't load infile");
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-25 10:28 UTC] tommi dot korhonen at iki dot fi
Forgot to say that web server runs on the same machine that CLI-PHP.
 [2006-07-25 10:28 UTC] tony2001@php.net
Obviously you didn't enable the extension, that's why it's not available.
Check which php.ini is used by CLI and make sure this php.ini has DOM extension enabled.
 [2006-07-25 10:40 UTC] tommi dot korhonen at iki dot fi
Damn, you're right! I presumed both CLI and non-CLI would use the same php.ini but obviously not. Thanks so much! 
Case closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC