Bugs php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login

go to bug id or search bugs for

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:2
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
[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

Pull Requests

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-2025 The PHP Group
All rights reserved. Last updated: Thu Oct 16 15:00:01 2025 UTC

AltStyle によって変換されたページ (->オリジナル) /