|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21499 include 'bogus'; refers to bogus function.main
Submitted: 2003-01-07 14:02 UTC Modified: 2003-01-07 20:45 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: philip at cornado dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.3.0 OS: all
Private report: No CVE-ID:
 [2003-01-07 14:02 UTC] philip at cornado dot com
<?php include 'foo' ?>

Warning: main(foo) [function.main]: 
  failed to create stream: No such file or directory in...

Warning: main() [function.main]: Failed opening 'foo' for inclusion (include_path='.') in...

Basically, this error could be a little nicer and in the very least link to function.include and not a non-existent function.main.

This is the case with all the include/require constructs.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-07 17:36 UTC]
Since include is not a function but rather a language construct this is unlikely to be ever fixed.
The error as is, imo is reasonably descriptive as it tells what action had failed and why.
 [2003-01-07 18:28 UTC]
The fact that it provides two 404 links to a non-existent PHP function named main() is rather misleading and is not reasonable.  I didn't call/use any function named main(), I used include().  Fact is, include() could not include the file because the file could not be opened.  Simply "Failed opening foo for inclusion" is enough, like it used to be before php_error_docref.  Linking to function.include would be fine too.

IMHO this should remain open until someone fixes it.  I would put php_error_docref in the summary but I really don't know the internals or if that's the problem.
 [2003-01-07 20:45 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 07:01:37 2015 UTC