|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-11-27 01:37 UTC] pehewa at a1 dot net
Description:
------------
System: Windows W2K or XP with Apache 2.0.54
My PHP-program exists for one year minimum without changes and runs at a provider (Version 4.4.1 - not under Windows) without errors.
A valid XML-file "nav.xml" should be read.
The error messages are after execution are:
Warning: domxml_open_file(): I/O in C:\pathtophpfile on line x
Warning: domxml_open_file(): warning in C:\pathtophpfile on line x
Warning: domxml_open_file(): failed to load external entity "nav.xml" in C:\pathtophpfile on line x
php.ini changes:
precision = 14
output_buffering = 4096
allow_call_time_pass_reference = Off
log_errors = On
error_log = C:\php_error.log
variables_order = "GPCS"
register_argc_argv = Off
magic_quotes_gpc = Off
extension_dir = "./extensions"
extension=php_domxml.dll
extension=php_xslt.dll
dbx.colnames_case = "lowercase"
session.gc_divisor = 1000
session.bug_compat_42 = 0
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
Loaded Modules out of the phpinfo():
core mod_win32 mpm_winnt http_core mod_so mod_access mod_actions mod_alias mod_asis mod_auth mod_autoindex mod_cgi mod_dav mod_dir mod_env mod_imap mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_setenvif mod_userdir mod_dav_svn mod_authz_svn sapi_apache2
Reproduce code:
---------------
$navdoc = domxml_open_file("nav_xml");
File nav.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<navigation>
<items>
<item parent="00">
<change>15.10.2005</change>
</item>
</items>
</navigation>
Expected result:
----------------
Getting the correct result (XML-Document Object) as on other Systems with PHP 4.4.1 or on Windows-Systems with PHP 4.3.2.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 06:00:02 2025 UTC |
$navdoc = domxml_open_file("nav_xml"); "nav_xml" looks obviously wrong, as the file is called "nav.xml".Sorry for making this essential mistake in my first bugreport. The line code should be: $navdoc = domxml_open_file("nav.xml");Thank you. I have tried your proposal - and it is running. So I have written a workaround for this problem - using the same code for Windows and Linux with Apache: function docpath () { // Get some information about the server software $software = $_SERVER['SERVER_SOFTWARE']; $win = strpos ($software, "Win32"); // Decides, running on a Windows system or not if ( $win > 0 ) { // Adds the absolute path $filename = $_SERVER['SCRIPT_FILENAME']; $pos = strrpos($filename, "/") + 1; $filepath = substr( $filename, 0, $pos ); } else { $filepath = ""; } return ($filepath); }