php.net |  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
Votes:2
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
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 

Patches

Pull Requests

History

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: Sun Dec 22 11:01:30 2024 UTC