PHP Memory Limitations

Post here if you are having problems with your account or web site.

PHP Memory Limitations

Postby Michael.Terence on Fri Apr 20, 2007 5:58 am

I'm running a photo gallery application and have run out of memory. Here's a blurb from the FAQ section of the gallery website. Would setting these in the .htaccess file work for me, or do I need to have you change it for me?

24 megs should do it.

Code: Select all
PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes exhausted?
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').

php_value memory_limit [new memory limit]
To change it to 24 MB, write:

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:

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:

ulimit -a
Or with PHP with a script check.php

<php>
Michael.Terence
Registered User
 
Posts: 11
Joined: Tue Jul 19, 2005 10:45 am

Postby Bigwebmaster on Fri Apr 20, 2007 6:18 pm

I increased the memory for PHP. Please let me know if you still have any problems.
UNFLUX.NET SUPPORT
User avatar
Bigwebmaster
Technical Director
 
Posts: 109
Joined: Sun Jun 27, 2004 10:54 pm

Postby Michael.Terence on Fri Apr 20, 2007 9:18 pm

I still have the same error. :(

Code: Select all
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4104 bytes) in /home/***********/public_html/clarke-family/gallery2/modules/core/classes/GalleryDataCache.class on line 323


Google tells me that 8388608 bytes = 8 megabytes so I'm guessing apache just needs to be restarted for the changes to take effect?

Thanks for doing this for us! :)
Michael.Terence
Registered User
 
Posts: 11
Joined: Tue Jul 19, 2005 10:45 am

Postby Bigwebmaster on Sat Apr 21, 2007 3:26 pm

Please try again. I am used to changing the php.ini file in the /etc directory, it isn't that way with Cpanel. Anyway it should be fixed now. Please check and let me know. Thanks!
UNFLUX.NET SUPPORT
User avatar
Bigwebmaster
Technical Director
 
Posts: 109
Joined: Sun Jun 27, 2004 10:54 pm

Postby Michael.Terence on Mon Apr 23, 2007 11:45 am

That did it! -- Thanks a bunch. :grin:
Michael.Terence
Registered User
 
Posts: 11
Joined: Tue Jul 19, 2005 10:45 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron