php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25655 failed include function halts execution
Submitted: 2003-09-25 09:53 UTC Modified: 2003-09-25 13:26 UTC
From: simon at eyeeye dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.3 OS: Linux 2.4
Private report: No CVE-ID: None
 [2003-09-25 09:53 UTC] simon at eyeeye dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-25 10:40 UTC] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2003-09-25 12:36 UTC] simon at eyeeye dot com
I have Turck MMCache and the Zend Optimizer installed on my system.  Both as Zend extensions.  
Disabling either one results in the correct behaviour.  With both running, execution stops prematurely.  
The relevant config lines are:

;zend_extension="/usr/lib/php4/mmcache.so"
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"

[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.1.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.1.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
 [2003-09-25 13:26 UTC] sniper@php.net
Not PHP bug. Report to the 3rd party extension authors.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC