php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17342 include() fails to open URLs
Submitted: 2002-05-21 15:52 UTC Modified: 2002-06-10 17:49 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: php at pgregg dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.1 OS: Windows 2000 Server
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at pgregg dot com
New email:
PHP Version: OS:

 

 [2002-05-21 15:52 UTC] php at pgregg dot com
Platform: W2K Server fresh install, IIS5.0, MySQL, PHP 4.2.1 and Oracle 8.1.7 Client.

PHP installed as an ISAPI filter and tested working, is also loading the php_oci8.dll and talking well to oracle.

However, a simple:
include ("http://localhost/test.txt");
fails everytime regardless of the URL supplied.  I have verified that DNS, etc is working and IE on the server can see the URLs ok.

php.ini has allow_url_fopen = On, and this is verified through phpinfo(), get_cfg_var("allow_url_fopen") and ini_get("allow_url_fopen")

Error message supplied by PHP is:
Warning: Failed opening 'http://aorr3/oss/ssi/header.html' for inclusion (include_path='.;f:\web\source') in F:\web\source\resolutions.php on line 6

Having include_path undefined in php.ini or set doesn't matter (tho it should not affect url opens).

Cheers

Paul, aka Qube

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-21 15:53 UTC] derick@php.net
Hey Paul,

can you verify if it works with the 4.3.0 snapshots (from snaps.php.net/win32)?
It might have been fixed by the new streams implementation.

Derick
 [2002-05-22 07:33 UTC] php at pgregg dot com
Hi Derick,

Noper, just tried it with 4.2.2-dev and same symptoms persist.

Cheers

Paul.
 [2002-05-22 07:39 UTC] derick@php.net
hmm... I thought I wrote 4.3.0 snapshots :) that's the things not marked STABLE @ snaps.php.net/win32 :)
Can you try again?

Derick
 [2002-05-22 07:43 UTC] edink@php.net
Poul I think Derick was referring to 4.3.0-dev (http://snaps.php.net/win32/php4-win32-latest.zip). 

FYI I can reproduce the problems you're having. 
 [2002-05-22 08:07 UTC] php at pgregg dot com
Hi Derick,

Sorry bout that...

Installed php4-win32-200205221000.zip  (latest)
and the problem persists.  there is an additional error message now:

Warning: main("http://aorr3/oss/ssi/header.html") - Invalid argument in F:\web\source\resolutions.php on line 6

Warning: Failed opening 'http://aorr3/oss/ssi/header.html' for inclusion (include_path='.;f:\web\source') in F:\web\source\resolutions.php on line 6

First 7 lines of code are below:
<?php

#print_r(get_cfg_var("allow_url_fopen"));
#print_r(ini_get("allow_url_fopen")ini_get("allow_url_fopen"));

  include ("http://aorr3/oss/ssi/header.html");

(7 line blank)

Cheers,

Paul.
 [2002-06-01 12:25 UTC] edink@php.net
It turns out that urls in include() for Windows are not supported. This fact should probably be documented.
 [2002-06-04 04:34 UTC] mfischer@php.net
The let's document it, and set it to criticil. This really should be clear to users on W2k platform, it's a major drawback.
 [2002-06-10 13:25 UTC] webmaster at uwth dot uni-hannover dot de
I've experienced this bug on Windows XP, 2000 Pro and 98.
 [2002-06-10 15:12 UTC] philip@php.net
features.remote-files.php has the following <note>:

"Note: You can't use remote files in include() and require() statements on Windows."

a) This bug will remain in 4.3.0?
b) Aside from php.net/include, any other places to add docs?
c) Same error regardless of allow_url_fopen value in php.ini?
d) Why can't windows include remote files?
 [2002-06-10 15:42 UTC] mfischer@php.net
a) This bug will remain in 4.3.0?

 It's not a bug, it's a feature request.

b) Aside from php.net/include, any other places to add docs?

 (include|require)_once

c) Same error regardless of allow_url_fopen value in php.ini?

 No, fopen("http://somewhere/"); works for me on win32. Doesn't it for you?
d) Why can't windows include remote files?

 Technical issue, ask zeev to explain. Something along the line that a socket != fd on win32 and that flex only supports fd's.

Since it's documented already, it's not critical anymore IMHO.
 [2002-06-10 15:45 UTC] php at pgregg dot com
I think these notes that it doesn't work on Win32 need
to go (also) on:
http://www.php.net/manual/en/function.include.php
http://www.php.net/manual/en/configuration.php#ini.allow-url-fopen
and in the distributed php.ini-dist

Paul.
 [2002-06-10 17:49 UTC] mfischer@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.

It's now better documented that it's not supported. The reference bug report for this is http://bugs.php.net/bug.php?id=13600&edit=1 , so closing this one.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 05:01:28 2024 UTC