From: Jared dot Williams1 at ntlworld dot com
Operating system: Windows 2000/IIS
PHP version: 5.0.1
PHP Bug Type: SimpleXML related
Bug description: chdir() before simplexml_load_file() causes warning
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 bug report at http://bugs.php.net/?id=30004&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30004&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30004&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30004&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30004&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30004&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30004&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30004&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30004&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30004&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30004&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30004&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30004&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30004&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30004&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30004&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30004&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30004&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30004&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30004&r=mysqlcfg