PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes

Mobile
feeds
Welcome Login | Register

PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes
Reply Your Comments:
Click this button if you are interested in replying to this topic and leave your comments
Sent To Friend
CLick this button if you want to send this page to a friend.
Subsribe To Rss Feeds
Subscribe to RSS
CLick this button if you want to subscribe to this RSS Feed. You can use your browsers feeds burners if you have mozilla or internet explorer 7 or higher and keep up with updates.
  Forums Index
      » MYSQL Forums
        » » PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes
PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes
Post Description: php memory limit why do i get the error allowed memory size of xxx bytes MYSQL
Post Tags:
This Post Has Been Viewed 11780 Times Since Mon Nov 06, 2006 11:09 pm Author bigger_travis with 1 replies
PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes
Advertise On This Page




Why do I get the error Allowed memory size of Xxx bytes exhausted?

this is because you have exhausted your memory on your server. this often happens when you have a large site or with big files or simply have really messy coding that requires alot of resources from your web server. In shared hosting, this is common. however, if you have a dedicated server you can chang the memory limit in your php.ini file to 16 or 32. but if you don't have a dedicated server you can create a .htaccess file to do the same without changing the php.ini file.

You are exhausting the available memory that PHP has access to. In php.ini there is a config variable named memory_limit that by default is set to 8MB. Edit php.ini and increase it to a larger value (restart Apache afterwards). If you don't have access to php.ini, you can add this line to your .htaccess file in your gallery2 folder. Usually, unless you are the owner of the server, you don't have access to change php.ini. If there is no .htaccess file yet, you can create one (it's just a text file with the name '.htaccess').


     Code:
php_value memory_limit [new memory limit]

To change it to 24 MB, write:


     Code:
php_value memory_limit 24M


If the .htaccess method does not work or if you get an internal server error after adding this line, remove the line from the .htaccess again. You can also try to change the memory_limit by adding the following line right after '<?php ' in install/index.php and in main.php:


     Code:
ini_set("memory_limit","32M");


If there's no "memory_limit" parameter in your phpinfo page, then all PHP/Webserver processes are limited by the per process max memory limit. You'll have to ask an administrator to change the limit in this case. On linux/unix, you can check the limit with the following command in the shell:


     Code:
ulimit -a


Or with PHP with a script check.php


     Code:
<?php print system('ulimit -a'); ?>



Leave Your Comments

Share:   Subscribe - Keep Up With This Topic
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites
URL:
To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
Fourms BBCODE:
Links Related to : PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes
Add Link:
No Links Have Been Added To This Topic

Comments and replies About PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes
:: 1 :: Reply #14847 Reply By JC On Wed Aug 08, 2007 6:29 pm
JC:
often this will help: use while loop instead of foreach loop. the foreach loop eats up memory. see my2.php.net/while and my2.php.net/foreach and search for the word "memory" in the comments.