#30004 [Opn->Fbk]: chdir() before simplexml_load_file() causes warning
| From: | rrichards@php.net | Date: | Fri, 12 Nov 2004 11:40:19 +0000 |
| Subject: | #30004 [Opn->Fbk]: chdir() before simplexml_load_file() causes warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68981@lists.php.net to get a copy of this message | ||
ID: 30004
Updated by: rrichards@php.net
Reported By: Jared dot Williams1 at ntlworld dot com
-Status: Open
+Status: Feedback
Bug Type: SimpleXML related
Operating System: Windows 2000/IIS
PHP Version: 5.0.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-09-07 04:46:56] Jared dot Williams1 at ntlworld dot com
Description:
------------
Changing the directory before using using simplexml seems to cause a
warning.
The warning is generated from within libxml2 and is WIN32 specific.
libxml2s' xmlInitializeCatalog() function in catalog.c tries to locate
a directory of some catalog files, fails due the chdir() performed in
PHP.
Reproduce code:
---------------
<?php
$xml = '..//config.xml';
$dir = dirname(realpath($xml));
var_dump($dir);
var_dump(chdir($dir));
$doc = simplexml_load_file(basename($xml));
var_dump(htmlspecialchars($doc->asXML()));
?>
Expected result:
----------------
No warning.
Actual result:
--------------
Warning: simplexml_load_file() [function.simplexml-load-file]: Unable
to access E:/php-5.0.1-Win32/../etc/catalog
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30004&edit=1