php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25508 domxml_open_file() does not work when using relative paths
Submitted: 2003-09-12 04:43 UTC Modified: 2003-09-12 15:20 UTC
From: mfladischer at gmx dot net Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.3.3 OS: *
Private report: No CVE-ID: None
 [2003-09-12 04:43 UTC] mfladischer at gmx dot net
Description:
------------
I get a bool(false) when trying to open a xml-file with a relative path. It works as expected with FQ paths.

Reproduce code:
---------------
<?php
// example.xml is in the same directory as this script
var_dump(domxml_open_file("example.xml"));
?>

Expected result:
----------------
A DOM-document object:
object(domdocument)....

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-12 06:32 UTC] helly@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

According to config and sapi used relative paths can be relative to executable, server executable, base url or current directory. RTFM.
 [2003-09-12 11:45 UTC] mfladischer at gmx dot net
Please see the Reproduce code:
// example.xml is in the same directory as this script

the path is relative to the path where the script resides. i'm using the apache2 module so paths relative to the location of the script should work. but they do not work with domxml_open_file()!
 [2003-09-12 15:20 UTC] sniper@php.net
In that case, libxml has a bug. Use ./somefile.xml instead.

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 07:01:24 2020 UTC