|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1761 require/include functions broken -- give "document contains no data error"
Submitted: 1999-07-20 14:14 UTC Modified: 2000-11-09 10:22 UTC
From: dmf14 at cornell dot edu Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.3pl1 OS: Linux
Private report: No CVE-ID: None
 [1999-07-20 14:14 UTC] dmf14 at cornell dot edu
Using the include or require function, seemingly anywhere, in a PHP script yields a "Document contains no data" error in Netscape or a "Unexpected network read error; connection aborted/Unable to access document" error in lynx.

file "" contains one line:

file "foo.php" contains six lines:
<html><head><title>Hello World!</title></head><body>
        echo " world!<br>\n";

Compile Information:  Have PHP4 compiled as a shared Apache module (DSO) under Apache 1.3.6.
Configure line:  ./configure --with-apxs=/usr/sbin/apxs --with-mysql --enable-track-vars 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-31 13:20 UTC] zeev at cvs dot php dot net
This is an Apache bug - Apache doesn't always properly generate
DSO modules.
It's fixed in Apache 1.3.7/1.3.8
 [2000-11-05 03:46 UTC] dmf14 at cornell dot edu
I have Apache 1.3.9 and include'ing doesn't work properly.

Please take a look at this:

Now, try these:

Precisely the same code. PHP on zeraim incorporates the header & footer and 
then parses all as one, while on terumah it is attempting to parse the 
header & footer as if they were independent of the file into which they are 

Or in other words, PHP used to incorporate a 'require()ed' file without 
doing any work on it, and then parsed the whole thing together. So you 
could have an IF statement in the header [ if (...) { ] that ended in the 
footer [ } ].

No longer! That's why the same code is generating parse errors.

 [2000-11-05 03:47 UTC] dmf14 at cornell dot edu added that last comment
 [2000-11-09 10:22 UTC]
Please read the manual:

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun May 31 04:01:25 2020 UTC