php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7815 include() / require() gives unable to access
Submitted: 2000-11-14 12:12 UTC Modified: 2000-12-30 19:58 UTC
From: ct at gocept dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.3pl1 OS: Linux 2.2.16
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: ct at gocept dot com
New email:
PHP Version: OS:

 

 [2000-11-14 12:12 UTC] ct at gocept dot com
Some includes in the php-code do fail with following message:

Warning: Unable to access ./test.php in /home/ctheune/public_html/minicept/handlers/passthrough/handler.class on line 8

Fatal error: Failed opening required './test.php' (include_path='') in /home/ctheune/public_html/minicept/handlers/passthrough/handler.class on line 8

1. They file is world-readable
2. The same thing is happening when using absolute paths
3. The same file is accessible from another file which included the file that is failing to include.
Sample:

Case A:
File A:
<? include("./handlers/test.php"); ?>  - Works

Case B:
File A:
<? include("./handlers/test1.php"); ?> - Works

File B ( aka: ./handlers/test1.php ):
<? include("./test.php") ?> - Doesnt work

My Oppinion:

Is it possible that nested includes / requires sometimes won't work?

Best regards

Christian Theune
www.gocept.com

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-14 12:21 UTC] ct at gocept dot com
Hmmmpf ... think i didnt check out everything ... 

is it possible, that the path to the includes is not shifted within an included file?

if file A is "/my/path/test.php" and it includes "/your/path/asdf.php", that if the second file includes "testyourself.php" not "/your/path/testyourself.php" but "/my/path/testyourself.php" is tried to be included?
 [2000-11-21 08:47 UTC] stas@php.net
No, the path is relative to the current script's path.
Could you please present the full pathes and include
structure that doesn't work for you?
 [2000-12-30 19:58 UTC] sniper@php.net
No feedback.

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jul 06 18:00:01 2026 UTC