|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-18 11:57 UTC] sas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
This is the test.phtml script: --------------------------------------------- <?PHP for ($i=0;$i<5000;$i++) { echo "$i: "; // Uncomment one of the following two lines include("hello.phtml"); // eval("echo 'Hello<BR>\n';"); flush(); } ?> --------------------------------------------- This is the hello.phtml script: --------------------------------------------- Hello<BR> --------------------------------------------- Uncomment one of the "include" or "eval" lines (the script behaves the same in both cases), then run php -f test.phtml then you will get the following fatal error after about 4095 lines of output: Unable to initialize a new token in cache Checking the memory usage in the whole system, it turns out that this test script quickly fills up about 30 Mb of memory, then stops with the above error. Version 3.0.5 had a similar problem, although it filled up only about 5 Mb, and did not stop after about 4095 lines (I tried with with 100000 in the "for" cycle), but rather filled up all memory the computer had. If I run this script through an Apache module, then in all cases it stops after about 4095 lines. The settings of the php3.ini file seem to be irrelevant, even the memory_limit option. Anyway, I only changed the default configuration in the max_execution_time option, and I included the mysql extension. I downloaded the binary 3.0.5 version from the Debian site, and I compiled the 3.0.7 version with no option (I simply said "./configure"). Since "eval" and "include" behave very similarly, I assume, that the problem is in a subfunction of these functions. There does not seem to be any reason, why these functions should leave memory behind after their run. I could get rid of "eval" from my program (almost), but I do need "include", I use it to regenerate our WWW pages from templates. Please, tell me, if you received this message, or if you have a solution or workaround. Thank you very much for your attention. Sincerely yours, Geza Makay