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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 + 35 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC