ID: 17445 Comment by: stv at seznam dot cz Reported By: mitch at webcob dot com Status: No Feedback Bug Type: Scripting Engine problem Operating System: FreeB SD 4.4 PHP Version: 4.2.1 New Comment:
Same problem. Why it haven't been solved yet in core? Just only first check if file exists before check for permissions. Why none feedback from here from some developers? I can describe this problem detaily: On server php5.cz with this configuration of php http://slapstick.php5.cz/info.php include_path is set: /www/7/site2017/:.:/usr/lib/php open_basedir is set: /www/7/site2017/ Reproduce code: In file /www/7/site2017/wwwroot/index.php : require_once('../controller/inc.controller.php'); In file /www/7/site2017/controller/inc.controller.php : error_reporting(E_ALL | E_STRICT); if (!include_once('inc.config.php')) die('Application error0'); Require works as expected. Include not. Because php is first searching in paths related to directory /www/7/site2017/wwwroot/ and after trying to include file /usr/lib/php/inc.config.php raises warning permission denied for this include (due open_basedir) and ends proccessing of script even if the file /usr/lib/php/inc.config.php doesn't exist. Why rising permission warning even if file doesn't exist? Expected result: Including file /www/7/site2017/controller/inc.config.php Actual result: Warning: main() [function.main]: open_basedir restriction in effect. File(/usr/lib/php/inc.config.php) is not within the allowed path(s): (/www/7/site2017/) in /www/7/site2017/controller/inc.controller.php on line 6 Warning: main(inc.config.php) [function.main]: failed to open stream: Operation not permitted in /www/7/site2017/controller/inc.controller.php on line 6 Warning: main() [function.include]: Failed opening 'inc.config.php' for inclusion (include_path='/www/7/site2017/:.:/usr/lib/php') in /www/7/site2017/controller/inc.controller.php on line 6 Application error0 Previous Comments: ------------------------------------------------------------------------ [2002-10-24 01:00:03] php-bugs at lists dot php dot net No feedback was provided for this bug for over 2 weeks, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2002-10-08 22:51:06] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-05-27 01:16:34] mitch at webcob dot com I have set open_basedir = /home/user I have set include_path = .:/home/user/lib:/home/user/site/lib I have a file located in: /home/user/site/htdocs/ which requires another file in the same directory. <?php require_once('file2.php'); ?> The include WORKS. BUT IT PRODUCED A WARNING: Warning: open_basedir restriction in effect. File is in wrong directory in /home/user/site/htdocs/file1.php on line 3 File2 is here. The "File2 is here" is produced by the included file. I've seen others comment on this problem, but could find no solution or open occurance of it in the bug list. Thanks. Mitch. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17445&edit=1