#21565 [Opn->Fbk]: safe_mode works well with include but not with require

From: Date: Fri, 10 Jan 2003 22:56:47 +0000
Subject: #21565 [Opn->Fbk]: safe_mode works well with include but not with require
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29734@lists.php.net to get a copy of this message
ID: 21565 Updated by: iliaa@php.net Reported By: komanek@natur.cuni.cz -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Tru64Unix 5.1A PHP Version: 4.3.0 New Comment: It is likely that your error reporting level is such that warning messages do not get shown. Unlike require which fails with an error include will only output a warning on failure. Beyond that there is very little difference between the require/include code none of which is the code reponsible for actually openning files. Previous Comments: ------------------------------------------------------------------------ [2003-01-10 03:35:37] komanek@natur.cuni.cz After upgrade from PHP 4.2.2 to 4.3.0 I encountered the problem with safe_mode in conjunction with require(). Example: [php.ini] safe_mode = On; include_path = ".:./:/path/to/my/app/dir"; safe_mode_include_dir = ".:./:/path/to/my/app/dir"; [/path/to/my/app/dir/index_working.php] - works fine for me <?php include "header.php"; ?> [/path/to/my/app/dir/index_buggy.php] - throws error <?php require "header.php"; ?> The error: [error] PHP Fatal error: main() [<a href='http://www.php.net/function.main'>function.main</a>]: Failed opening required 'header.php' (include_path='.:./:/path/to/my/app/dir') in /path/to/my/app/dir/index_buggy.php on line 2 Operating system: Tru64Unix 5.1a Webserver: Apache 1.3.26 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21565&edit=1

« previous php.bugs (#29734) next »