php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37749 require does not function properly under certain conditions
Submitted: 2006-06-08 17:49 UTC Modified: 2006-06-08 17:52 UTC
From: eroberts at gowfb dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.4.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: eroberts at gowfb dot com
New email:
PHP Version: OS:

 

 [2006-06-08 17:49 UTC] eroberts at gowfb dot com
Description:
------------
If you are in directory: rootdir/

and you require file: rootdir/dir/file1.php

and file1.php requires file2.php

if a file named file2.php does not exist in rootdir/, then file2 will be rootdir/dir/file2.php,

BUT, if a file named file2.php exists in rootdir/, then file2 will be rootdir/file2.php

Reproduce code:
---------------
#### base.php
require 'somedir/file1.php';

#### file1.php
require 'file2.php';



Expected result:
----------------
if ./file2.php exists, then file1.php will include ./file2.php

if ./file2.php does not exist and ./somedir/file2.php exists, then file1.php will include ./somedir/file2.php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-08 17:52 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Use absolute path if you don't want require() to use include_path.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC