#46035 [NEW]: fopen() fails to open successful HTTP 207 Multi-Status response
From: ms419 at freezone dot co dot uk
Operating system:
PHP version: 5.2.6
PHP Bug Type: Streams related
Bug description: fopen() fails to open successful HTTP 207 Multi-Status response
Description:
------------
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:
---------------
<?php
$filename = 'http://qubit-toolkit.googlecode.com/svn/trunk/';
$context = stream_context_create(array('http' => array(
'method' => 'PROPFIND',
'header' => 'Depth: 1')));
$handle = fopen($filename, 'r', false, $context);
var_dump($handle);
Expected result:
----------------
$handle should be a resource from which I can read the server's successful
response:
PROPFIND /svn/trunk/ HTTP/1.0
Host: qubit-toolkit.googlecode.com
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="http://subversion.tigris.org/xmlns/svn/"
xmlns:C="http://su
bversion.tigris.org/xmlns/custom/"
xmlns:V="http://subversion.tigris.org/xmlns/d
av/" xmlns:lp1="DAV:" xmlns:lp3="http://subversion.tigris.org/xmlns/dav/"
xmlns:
lp2="http://apache.org/dav/props/">
<D:href>/svn/trunk/</D:href>
[...]
Actual result:
--------------
ket% php fopen.php
Warning: fopen(http://qubit-toolkit.googlecode.com/svn/trunk/): failed to
open stream: HTTP request failed! HTTP/1.0 207 Multi-Status
in /home/jablko/public_html/fopen.php on line 7
bool(false)
ket%
--
Edit bug report at http://bugs.php.net/?id=46035&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46035&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46035&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46035&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46035&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=46035&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46035&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46035&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46035&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46035&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46035&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46035&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46035&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46035&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46035&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46035&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46035&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46035&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46035&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46035&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46035&r=mysqlcfg
Thread (4 messages)
- ms419 at freezone dot co dot uk