PHP XML Get Error

alqaatri

New Member
I wrote a PHP Application (that works) and I have moved it to a different directory. As a result it needs to get a file from a directory above it, but the file must remain hidden, ie:
  • Root
  • --config
  • ---users.xml (Permissions 600)
  • --lib
  • ----loginUtil.php
I have tried two different methods of getting the file:\[code\] $xml = file_get_contents("../config/users.xml"); Which returns the following Error: [13-Jun-2012 08:54:04] PHP Warning: file_get_contents(../config/users.xml) [<a href='http://stackoverflow.com/questions/11017769/function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in public_html/test/lib/loginUtil.php on line 18\[/code\]and\[code\] $xml = simplexml_load_file("../config/users.xml"); which returns [13-Jun-2012 08:56:17] PHP Warning: simplexml_load_file() [<a href='http://stackoverflow.com/questions/11017769/function.simplexml-load-file'>function.simplexml-load-file</a>]: I/O warning : failed to load external entity \[/code\]I have tried using the full URL, and that works, but I must then make the users.xml file public (as PHP is doing a URL Request). What can I do to resolve this issue? (Thanks for your help)
 
Back
Top