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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 + 24 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC