|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46035 fopen() fails to open successful HTTP 207 Multi-Status response
Submitted: 2008-09-09 23:35 UTC Modified: 2008-10-18 18:15 UTC
From: ms419 at freezone dot co dot uk Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
 [2008-09-09 23:35 UTC] ms419 at freezone dot co dot uk
I am working on a PHP interface to WebDAV repositories using fopen(). I use fopen() to make a PROPFIND request to the server, hoping to use DOM to parse the result. Unfortunately fopen() fails even on successful responses from the server

Reproduce code:

$filename = '';
$context = stream_context_create(array('http' => array(
  'method' => 'PROPFIND',
  'header' => 'Depth: 1')));
$handle = fopen($filename, 'r', false, $context);

Expected result:
$handle should be a resource from which I can read the server's successful response:

PROPFIND /svn/trunk/ HTTP/1.0

Depth: 1

HTTP/1.0 207 Multi-Status
Date: Tue, 09 Sep 2008 23:34:32 GMT
Server: Apache
Content-Type: text/xml; charset="utf-8"
Connection: Close

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:S="" xmlns:C="http://su" xmlns:V="
av/" xmlns:lp1="DAV:" xmlns:lp3="" xmlns:

Actual result:
ket% php fopen.php 

Warning: fopen( failed to open stream: HTTP request failed! HTTP/1.0 207 Multi-Status
 in /home/jablko/public_html/fopen.php on line 7


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-10 00:58 UTC]
Please try using this CVS snapshot:
For Windows (zip):

For Windows (installer):

Seems to work just fine here...
 [2008-09-17 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".
 [2008-10-18 18:15 UTC]
This bug has been fixed in PHP 5.3.
 [2012-02-01 05:47 UTC] josh at joshbutts dot com
This does not appear to be fixed in 5.3.6 compiled from source on Mac OS 10.7
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 07:01:31 2024 UTC