|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-25 10:40 UTC] sniper@php.net
[2003-09-25 12:36 UTC] simon at eyeeye dot com
[2003-09-25 13:26 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Description: ------------ The Documentation for include says that including a missing file will result in a warning, wheras require will resulit in an error and halt execution. I've encoutered two servers where this doesn't appear to be the case. On one server (where I have no access to syslog) program execution simply fails with no output when I try to include a file that it can't find. On another server I have, I produced a test file which attempts to include several files, some exist, some don't. Again it returns no output even though files which are included before the first erroroneous include do generate output. The syslog shows only one PHP Warning, even though there should be multiple warnings. This may be a configuration problem, but I've tried reconfiguring everything I can think of, still to no avail. FYI output_buffering is off, implicit_flush is off, display_errors is on, error_reporting is ERR_ALL (2047) Reproduce code: --------------- First create file contents.html containing: <h1>TEST</h1> Then create test.php containing: <?php include("contents.html");?> <?php include("firsterror.php");?> <?php include("seconderror.php");?> Expected result: ---------------- I'd expect to see: <h1>TEST</h1> PHP Warning: main(firsterror.php): failed to open stream: No such file or directory in /home/testsites/test1/web/test.php on line 2 PHP Warning: main(seconderror.php): failed to open stream: No such file or directory in /home/testsites/test1/web/test.php on line 3 and in syslog: Sep 25 14:52:26 sibaz httpd: PHP Warning: main(firsterror.php): failed to open stream: No such file or directory in /home/testsites/test1/web/test.php on line 2 Sep 25 14:52:26 sibaz httpd: PHP Warning: main(seconderror.php): failed to open stream: No such file or directory in /home/testsites/test1/web/test.php on line 3 Actual result: -------------- Nothing is output, syslog contains one line of relevence: Sep 25 14:52:26 sibaz httpd: PHP Warning: main(firsterror.php): failed to open stream: No such file or directory in /home/testsites/test1/web/test.php on line 2