|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30004 chdir() before simplexml_load_file() causes warning
Submitted: 2004-09-07 04:46 UTC Modified: 2004-11-20 01:00 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: Jared dot Williams1 at ntlworld dot com Assigned:
Status: No Feedback Package: SimpleXML related
PHP Version: 5.0.1 OS: Windows 2000/IIS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: Jared dot Williams1 at ntlworld dot com
New email:
PHP Version: OS:


 [2004-09-07 04:46 UTC] Jared dot Williams1 at ntlworld dot com
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:

		$xml = '..//config.xml';
		$dir = dirname(realpath($xml));
		$doc = simplexml_load_file(basename($xml));

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 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 12:01:29 2024 UTC