php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64028 include_path starting with "." doesn't actually start the search in current dir
Submitted: 2013-01-18 22:10 UTC Modified: 2013-02-18 00:36 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mike at kristopeit dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.3.21 OS: CentOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike at kristopeit dot com
New email:
PHP Version: OS:

 

 [2013-01-18 22:10 UTC] mike at kristopeit dot com
Description:
------------
i have code that runs via the command line... the php include path is set to 
".:/some/dir"

that code does an
include("file.php"); 
for a file that is in the same directory.  that file is included correctly.

then in "file.php" i have
include("another_file.php"); 
for another file in the same directory... but there is also a file at 
/some/dir/another_file.php...

using a backtrace log i see that the /some/dir/another_file.php is being included 
instead of the file in the current directory.

i changed the include("another_file.php"); to be include("./another_file.php");, 
and now everything works.

this is a pretty obvious bug. 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-21 01:11 UTC] aharvey@php.net
I can't reproduce this, but bear in mind that . doesn't mean "the directory of the file PHP is currently executing", but rather "the current working directory of the process". Which directory are you invoking PHP in, and what does echo getcwd(); indicate your current working directory is before your include? Is it /some/dir or the directory file.php is in?

If that all seems right, I suspect we'll need a self contained reproduce script from you.
 [2013-01-21 01:11 UTC] aharvey@php.net
-Status: Open +Status: Feedback -Package: Dynamic loading +Package: Scripting Engine problem
 [2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Nov 28 11:05:53 2022 UTC