Bug #53849 [Com]: Nested includes not resolved
| From: | nevermind at phpsimplicity dot com | Date: | Thu, 27 Jan 2011 07:41:42 +0000 |
| Subject: | Bug #53849 [Com]: Nested includes not resolved | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158223@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53849&edit=1
ID: 53849
Comment by: nevermind at phpsimplicity dot com
Reported by: nevermind at phpsimplicity dot com
Summary: Nested includes not resolved
Status: Bogus
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows XP SP3
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Very well. I though I might report this strange behavior. I was not
really asking for help as the work around is very easy which is removing
the nesting and include both files explicitly in c.php and remove the
include from b.php.
Previous Comments:
------------------------------------------------------------------------
[2011-01-26 18:13:07] pajoye@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. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2011-01-26 17:52:02] nevermind at phpsimplicity dot com
Description:
------------
I have the following structure:
common/a.php
parent/b.php
parent/child/c.php
Now, in c.php, I included the file b.php from the "parent" folder using
relative path. b.php includes a.php from "common" folder using also
relative path.
When I call c.php, it fails to include common/a.php within parent/b.php
However, when I call b.php it includes common/a.php with no problem.
And just to be clear, I have code in b.php (the actual one) that I need
to keep separate from both a.php and c.php..
I have two physically different servers:
Development:
- Windows XP SP3
- Zend Server Community Edition 5.0.2 (Running PHP 5.3.2)
Production:
- Windows 2000 Small Business Server
- Apache 2.2
- PHP 5.3.5 (As Apache module)
Test script:
---------------
[a.php]
<?php
echo 'I am in!';
[b.php]
<?php
require_once '../common/a.php';
[c.php]
<?php
require_once '../b.php';
Expected result:
----------------
When c.php is executed, the inclusion of common/a.php and the output
of:
"I am in!"
Actual result:
--------------
Production Server:
Warning: require_once(../common/a.php): failed to open stream: No such
file or directory in D:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\test\parent\b.php on line 3 Fatal error:
require_once(): Failed opening required '../common/a.php'
(include_path='.;C:\php\pear') in D:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\test\parent\b.php on line 3
Development Server:
Warning: require_once(../common/a.php) [function.require-once]: failed
to open stream: No such file or directory in C:\Program
Files\Zend\Apache2\htdocs\test\parent\b.php on line 2
Fatal error: require_once() [function.require]: Failed opening required
'../common/a.php' (include_path='.;C:\Program
Files\Zend\ZendServer\share\ZendFramework\library') in C:\Program
Files\Zend\Apache2\htdocs\test\parent\b.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53849&edit=1