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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Sat Feb 29 10:01:27 2020 UTC