php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47157 require_once('relative/path/some.file') includes file twice (symlinks involved)
Submitted: 2009-01-19 23:06 UTC Modified: 2009-01-22 13:50 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: stephanie4343 at yahoo dot com Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.2.8 OS: FreeBSD 7.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-01-19 23:06 UTC] stephanie4343 at yahoo dot com
Description:
------------
What does the require_once function use to determine if a file has already been included or not?

Could mounting a filesystem with noatime affect it ? 
or serving it over NFS (with noatime) ?

p.s. the file I'm including is only in 1 directory


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-20 02:55 UTC] stephanie4343 at yahoo dot com
Hi, Thanks for the reply

Is there a way to print the internal array that require_once is using so I can diagnose this in the production environment ?
 [2009-01-20 12:33 UTC] jani@php.net
I asked for sample script because I'm guessing you propably used relative path instead of absolute. And hence could have issues with symlinks and such. So please give a short script that clearly demonstrates the problem.
 [2009-01-22 04:31 UTC] stephanie4343 at yahoo dot com
/home is a symlink to /usr/home as usual

the code is in /home/phonecode

you are right about the relative paths being used in the require_once calls.

once I changed the include_path to begin with /usr/home/phonecode rather than /home/phonecode it was resolved

but I'm dying for an answer as to why ?  
it still doesn't make sense to me as to why it would include it twice, or believe it hasn't inculded it the first time
 [2009-01-22 13:48 UTC] jani@php.net
IIRC, there is some issue with realpath() and *BSD. As in: It does not work. Just don't use relative paths. Ever.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC