php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30681 include() not including chained include() files
Submitted: 2004-11-04 00:11 UTC Modified: 2004-11-04 08:09 UTC
From: php at healthfleet dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.9 OS: Linux/WinXP
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: php at healthfleet dot com
New email:
PHP Version: OS:

 

 [2004-11-04 00:11 UTC] php at healthfleet dot com
Description:
------------
Ok, I have found a couple of spots mentioning this, including here. But no solid answer.
This code works fine on 2 WinXP boxes, 1 RH linux box, and another misc linux (I think also RH). So I'm thinking this isn't a relative position issue.

However it does not work on a custom Web Server Application box (aka Cobalt RaQ 550).

Reproduce code:
---------------
Here is the senerio:
DOCUMENT_ROOT: /home/.sites/143/site2/web/
SitePath of index.php: /modules/adminpanel/
SitePath of privileges.php: /modules/adminpanel/
SitePath of fleet_functions.php: /includes/
SitePath of fleetdb.php: /includes/

File1: index.php
<?
  $myRoot = $_SERVER['DOCUMENT_ROOT'];
  include("privileges.php");
?>
File2: privileges.php
<?
  include_once("$myRoot/includes/fleet_functions.php");
?>
File3: fleet_functions.php
<?
  include("fleetdb.php");
?>

Expected result:
----------------
I expected all the files to be included like they have on my local box testing and server testing. This is something unique about my new development test server.

Actual result:
--------------
I get an error message on the fleet_functions.php file:

Warning: main(fleetdb.php): failed to open stream: No such file or directory in /home/.sites/143/site2/web/includes/fleet_functions.php on line 2

Warning: main(): Failed opening 'fleetdb.php' for inclusion (include_path='') in /home/.sites/143/site2/web/includes/fleet_functions.php on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-04 08:09 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Add "/includes/" to your include_path.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC