php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26670 Repeated use of include() function causes fatal error.
Submitted: 2003-12-19 13:54 UTC Modified: 2003-12-19 14:05 UTC
From: transporteraccident at hotmail dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.3 OS: Fedora Core 1
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: transporteraccident at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-12-19 13:54 UTC] transporteraccident at hotmail dot com
Description:
------------
I've been trying to use multiple levels of includes to create a kind of inheritance effect.  Each directory has an "init.php" which includes the "init.php" file from the directory one level above.  I was hoping to have this work, but after a few levels deep, I start getting errors like:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3840 bytes) in /www/php-example/1/init.php on line 2

Logically, I'm thinking this should work, since each include file will include the file from above and, so forth.

Reproduce code:
---------------
http://129.219.146.200/php-example/1/2/init.php

Expected result:
----------------
File name: /php-example/init.php
Current value of $path = /php-example/
File name: /php-example/1/init.php
Current value of $path = /php-example/1/
File name: /php-example/1/2/init.php
Current value of $path = /php-example/1/2

Actual result:
--------------
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3840 bytes) in /www/php-example/1/init.php on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-19 14:05 UTC] eru@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.

Increase the size of memory_limit in the php.ini.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 14:01:34 2025 UTC