php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24053 include issues spurious "stream" warning that clutters up the page ...
Submitted: 2003-06-06 00:25 UTC Modified: 2004-02-12 14:01 UTC
Votes:79
Avg. Score:4.6 ± 0.8
Reproduced:73 of 76 (96.1%)
Same Version:47 (64.4%)
Same OS:46 (63.0%)
From: jphey at netdoor dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.2 OS: Linux 2.4.20
Private report: No CVE-ID:
 [2003-06-06 00:25 UTC] jphey at netdoor dot com
I have used the include "http://...." directive with great success.

However, my web hosting company (hostforweb.com) must have just upgraded their PHP software within the last week, because now ALL my pages that use the include command include "Warning: main(): stream does not support seeking /home/americaf/public_html/agenda/index.php on line 1" 

The funny thing is, the actual include appears to "work" properly ... the file IS included in the stream!  However, the warning message appears anyway.

Here is a URL that demonstrates the problem:

http://americafirstparty.org/agenda/index.php

the first several lines of which are:

=========== begin index.php source ==========

<?php include "http://americafirstparty.org/includes/plainpageheader.shtml"; ?>
<blockquote>


<h1>National Committee Meeting Agenda</h1>
<h3>Tuesday, May 20, 2003<br>Continued on May 27, 2003</h3>

=========== end of source snippet ============


I know this bug was fixed earlier, but perhaps it has resurfaced? 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-06 01:48 UTC] sniper@php.net
Don't include local files via http://..., use the correct path.

 [2003-06-06 15:37 UTC] admin at 1000rpm dot net
What about non-local files?  The error still comes up for those...
 [2003-06-19 08:26 UTC] andy dot roche at igraphicsmedia dot com
I would concer that something has gone wrong with the include AND require statements.  I am getting the stream error message on any that use a URL to point to them.  If the file is local to the page being processed (i.e. <?php [include/require] ('header.htm'); ?>) then it won't error out.  The error ONLY occurs processing remote addresses (i.e. <?php [include/require] ('http://somewhere.com/header.htm'); ?>).  Suppressing the error message will only hide the problem, not fix it.  I don't mind not having my visitors see the errors, but it would be nice to the problem fixed as well.
 [2003-07-25 03:49 UTC] wez@php.net
Apparently there is still a problem. Will investigate this weekend.
 [2003-09-16 23:48 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Cannot replicate the described problem.
 [2003-09-22 06:48 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-11-06 15:40 UTC] info at web-bureau dot com
Hi,
  I'm experiencing this on PHP 4.3.3 on Linux. I notice that variables defined in the remote included file are *not* then available in the including file!..

Is there any way round this for remote files?
 [2003-11-06 15:45 UTC] info at web-bureau dot com
I think this should be opened again - especially as it's not just a case of cluttering up the page - the include only half-works! The file is evaluated, but it's variables don't get back to the calling file.
 [2003-11-07 04:26 UTC] al at hosteurope dot de
The bug still exists in php-4.3.4. If you use include("http://www.example.com/test.php"); you will get a stream doesn't support seeking error.

We've investigated the problem and we think that there is only a 2 line if cause missing (compared to the bugfree version 4.3.1) at the beginning of the function _php_stream_seek in the main/streams.c code:

954a955,958
>       /* not moving anywhere */
>       if ((offset == 0 && whence == SEEK_CUR) || (offset == stream->position && whence == SEEK_SET))
>               return 0;
> 

if you insert this if cause the error disappears and all other functions still seem to work fine in our tests.

Best regards

Andree Lindenblatt
Software Development
Host Europe GmbH
 [2003-11-25 03:10 UTC] refuse_2_see at hotmail dot com
i still can't get this working, what do i do for http://kotl-clan.org/nick/poll/poll.php
 [2003-11-27 08:39 UTC] trash at mothertech dot it
Hello there,

I experienced this problem only with Zend Optimizer 
installed.

When I disable Zend Optimizer everything works fine.

Ciao

Gabriele
 [2004-01-04 11:21 UTC] the_sandking at hotmail dot com
Indeed, Zend optimizer is newly installed and I am having the same problem including a local file..

include('../../dir/filename.php');

This complains via the browser about "failed to open stream: No such file or directory" But in fact inclues the file in question...
 [2004-01-16 04:15 UTC] choinet at rocketmail dot com
To the two comments asking about using variables defined in the remote file, one must realize that the external file is parsed and the html output is only returned for inclusion.

Also, the above comment does not directly deal with external url inclusions generating a warning, unless Zend Optimizer causes the same warning as such.

I am experiencing the same problem on a PHP 4.3.4/Linux/Apache 1.3.29 server. The odd thing is that this problem does not occur on my Windows testbed or three other Linux/PHP 4.3.4 hosts.
 [2004-01-17 03:26 UTC] choinet at rocketmail dot com
The other hosts that worked fine did not have the Zend Optimizer, just to clarify.
 [2004-01-17 05:43 UTC] wez@php.net
If it only happens when you have Zend Optimizer loaded,
it's a Zend Optimizer bug.  URL includes under windows
are handled slightly differently internally (due to flex/
bison issues when working on sockets), which would explain
why you don't have the problem there.
 [2004-01-17 18:20 UTC] sniper@php.net
Not PHP but Zend Optimizer bug -> bogus.

 [2004-01-25 12:15 UTC] webmaster at nowproduction dot com
I had the same error "Warning: main(): stream does not support seeking...".

You can include remote files with adding an '@'. This code should work:

<?php
@include('http://remoteurl.com/somefile.html'); ?>
 [2004-02-03 19:52 UTC] rgraham at star-fleet dot org
Running 4.3.4 with Zend installed same issue, seems this states it's listed at 4.3.2, i thought i'd bring it up.

Even if it is a Zend Issue with Php doesn't it still fall into PHP's bug list? Seems it wasn't there before and now it is?

The @include works because @ = supress the error messeges but it's annoying.
 [2004-02-12 14:01 UTC] zeev@php.net
That bug is fixed in the Zend Optimizer 2.5 (http://www.zend.com/store/free_download.php?pid=13)
 [2004-04-10 14:00 UTC] gunner at muchthesame dot com
I just moved my site to a host running PHP 4.3.4 and I am now getting this same message.  I am including a file that is created on another site of mine and therefore have to use the full url in the include.

The include works fine, but I do get this error about "seeking" even though I am not seeking.  If I suppress the error it seems to be okay but I obviously shouldn't have to do this.
 [2004-04-19 23:48 UTC] coolavin at dedanaan dot com
I'm still getting this same error in php includes, so apparently, it still hasn't been fixed in the latest releases.

Using @include seems to work, suppressing the error message, but it's not a solution, it just masks the problem.

A fix needs to be applied to the next update.
 [2004-04-21 18:22 UTC] admin at 516homes dot com
I was getting this error on many of my websites which are spread on several servers all with same version 4.3.2.  I dont understand why it happens on one server as opposed to another? 

I was using it on http://www.ScriptWiz.com and then I transferred some files to another server site called http://www.skinz.org and it kept saying:

 Warning: main(): stream does not support seeking in /home/sitename/public_html/headernone1.php on line 193

But the same file on one server never exhibited this. Both servers running 4.3.2.  

I did use the @ and it has gone away for now.

kevin
 [2004-05-08 00:20 UTC] u_cant_take_me at hotmail dot com
This is a common problem but its REALLY simple! Instead of pasting huge chunks of code all you need 2 do is make php not report errors on the file.

use the following code and it should work fine

<?php
error_reporting(0);
include("http://www.iainshortreed.net/webhome/gone.php");
?>

(That is a good piece of code to test with)
That should solve the problem, for more information about not reporting some errors but reporting others you should take a look at......
http://www.php.net/error_reporting
 [2004-07-07 09:14 UTC] info at grestmedia dot de
On my site nothing which was suggest above works to fix the problem.
It doesn't work with @include and it doesn't work when I include local files.
And the error_reporting(0) does not work also.
At the moment I can't see any chance to get my site working again. How can it be that on all other host @include works but not on mine?
URL is www.klingelton24.info

greg
 [2004-08-06 07:00 UTC] webfriends at greentreesoftware dot ca
I see this issue is "CLOSED" but according to the comments I see above, this issue is very much "OPEN" for folks who are trying to make things work in the real-world.

Is this closed "RESOLVED, thanks for pointing out the problem" or is this closed "Works on my machine, the rest of the world must be broken???"

Thanks for clarifying that.
Greg
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 13:02:46 2014 UTC