|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 05:00:01 2025 UTC |
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.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 GmbHIndeed, 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...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'); ?>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