php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23752 Three level include crashes PHP
Submitted: 2003-05-22 07:57 UTC Modified: 2003-05-23 20:59 UTC
From: martzell+php at fastmail dot fm Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.2 OS: Windows 2000
Private report: No CVE-ID: None
 [2003-05-22 07:57 UTC] martzell+php at fastmail dot fm
The php.exe crashes when I try to include a file which includes a file one level higher, which also includes a file one level higher. Can't PHP include files three times?

My website navigation based on includes. The ./navigation.inc.php includes ../navigation.inc.php and contains links. So I have a simple two level navigation based on includes. This works.

But now I needed a third level of navigation. So a third navigation.inc.php includes the file, which contains the second level navigation and the include to the first level navigation.

I think the good stable SSI (Server Side Includes) isn't interpreted in .php-files by default, before the PHP is interpreted or interpreted at all. So SSI is no solution like in ASP which has no own include directive.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-23 03:08 UTC] martzell+php at fastmail dot fm
There is no installer. The install.txt doesn't describe how to update. There is an entry "PHP 4.3.1" found in Control Panel > Add / Remove Programs.

Now I have to possibilities:
 1) Replacing the files under C:\PHP, with the newer ones from the .zip-File. But there are many more files in the archive than in C:\PHP. The entry in the Add / Remove Programs Dialog wouldn't be correct anymore. Does this work (especially with the IIS-Configuration)?
 2) Uninstall PHP 4.3.1 from Add / Remove Programs. Unpack the archive to C:\PHP\. Configure the IIS.

What should I do?
 [2003-05-23 09:51 UTC] sniper@php.net
Even without seeing any example code I know this is not bug 
in PHP, you just end up in an endless loop by including same
file from another file which includes the first file..

Ask support questions on how to use PHP elsewhere.
Also, include_once() is your friend..

 [2003-05-23 11:10 UTC] martzell+php at fastmail dot fm
No endless loop anywhere in the code. Even if, PHP shouldn't crash. I tried the new version 4.3.2 by replacing the files. It still crashes. You are not willing to take this serious due to my last comment. I withdraw this comment. Support is a better place for this usability problem. Sorry, on my Macintosh I didn't have to install software I just can use it.

Works this code without crash on other machines? The Windows machine I use seems to be instable because long time not re-installed. But this shouldn't affect PHP.

FILE /2003/header.inc.php ----------------------------------          ...
            <td align="center" height="91" valign="top">
              <?php
                include("navigation.inc.php");
              ?>
            </td>
          ...

FILE /2003/navigation.inc.php ------------------------------<font face="sans-serif" size="+1"><b>
...

FILE navigation.inc.php ------------------------------------<?php
  include("../navigation.inc.php");
?>

<br>
<font face="sans-serif"><b> 
...

FILE news.php ----------------------------------------------<?php
  include($_SERVER['DOCUMENT_ROOT'] . "/2003/header.inc.php");
?>

<p><font face="sans-serif" size="+1"><b>News</b></font></p>
...
 [2003-05-23 20:59 UTC] wez@php.net
You have created an infinite loop with your chosen combination of include_path and the names of your include files.

Please read the documentation for include_path, include and include_once carefully.

It's probably a good idea to choose different names, or use fully qualified paths to the files.

You can ask further questions using one of the support forums listed here:
http://www.php.net/support.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 15:01:31 2024 UTC