Re: Re: Allowed memory size of
| From: | david forums | Date: | Tue, 21 Jun 2005 07:31:59 +0000 |
| Subject: | Re: Re: Allowed memory size of | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-217274@lists.php.net to get a copy of this message | ||
Bob
I try to run your test script.
So before the file reading the memory is 125730 o, and I 'm not able to get the next text due to error display
CURRENT MEMORY USAGE = 125720
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes)
I tried to set the memory_limit in the script and set a default value more efficient in the php.ini
That show the same error.
Thanks for your helps
david
Le Mon, 20 Jun 2005 16:46:36 +0200, Bob Winter <b2winter@yahoo.com> a écrit:
David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, inseveral places if necessary, it should help you debug it . // PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-usage.phpprint 'CURRENT MEMORY USAGE = '.memory_get_usage().'<br />'; // PRINT CURRENT MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-get.php print 'MEMORY LIMIT = '.ini_get('memory_limit').'<br />'; You can also set the memory limit on a per page basis// SET MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-set.php$mem_limit = '128'; print "SETTING MEMORY LIMIT TO $mem_limit Megabytes<br />"; ini_set('memory_limit', $mem_limit.'M'); //http://us4.php.net/manual/en/ini.core.php#ini.memory-limit There are a variety of limitations and restrictions to the commands noted above, be sure to read the documentation. -- Bob david forums wrote:Hello I got the following message. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I read on several forums to increase the size of the memory limit in php.ini. As you can wee which as already be done cause 134217728>69505726. But I still get the message. I'll like to understand and find how to do. The aim of this script is to get a big file (69MB) and to encrypt (using mcrypt). then to send it by ftp. Thanks for your helps david