funnyside Posted September 6, 2009 Share Posted September 6, 2009 Hi,i'm getting this error Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 10080001 bytes) in /home/fsolent/public_html/prestashop/images.inc.php on line 155I tried to look for the line and fix it but nothing. Help would be appreciated Link to comment Share on other sites More sharing options...
codegrunt Posted September 6, 2009 Share Posted September 6, 2009 The issue here is that your PHP server configuration has a lower maximum RAM usage set than that needed by PrestaShop during the resizing process. Currently yours is set to 32MB from the error message (which is not unreasonable). My question would be whether you can upload even very small images (try something 1K or 2K in size as a test) or if this occurs with every image resize attempt regardless?If it happens for everything then the issue is that the way things are organized internally in PrestaShop is going to use a lot of RAM and require a larger memory_limit set for the server or at least your directory via a .htaccess file (assuming your host allows this). But it could just be that you are uploading a far too large image and that if you resized it first you would not have this problem.Cheers Link to comment Share on other sites More sharing options...
funnyside Posted September 6, 2009 Author Share Posted September 6, 2009 Well basically the images for the shop are each around 500kb, 6 items 2 categories Link to comment Share on other sites More sharing options...
codegrunt Posted September 6, 2009 Share Posted September 6, 2009 If these are JPEGs, a 500KB file translates to around 11MB when uncompressed in memory. Keep in mind that JPEGs are compressed files and you also need to deal with the rest of the codebase's objects being in RAM too.You could try bumping up the maximum memory allowed for PHP to 64MB. This can be done via the php.ini file for the host (remember to restart Apache after changing this) or via a .htaccess file:php_value memory_limit 64MYou could also try adding the following to one of the bootstrap files for PrestaShop:ini_set('memory_limit', '64M');Keep in mind your server may have this config option disabled for you. A way to test would be to set up a simple script like this:<?phpini_set('memory_limit', '64M');phpinfo();?>Search for "memory_limit" and see what it is set to - if it says 64MB then you will be good to go to make the change. If it is still 32MB then you are probably out of luck unless the host will change the default for you.Cheers Link to comment Share on other sites More sharing options...
funnyside Posted September 6, 2009 Author Share Posted September 6, 2009 Erm i'm a beginner when it comes to this stuff, so what exact files would I need to change and where? Link to comment Share on other sites More sharing options...
codegrunt Posted September 6, 2009 Share Posted September 6, 2009 Assuming you are on a UNIX / FreeBSD / Linux based host running Apache as the webserver, take a look for a file called ".htaccess" in your web root. If not already there, add a line at the top of it that looks like this: php_value memory_limit 64MIf you get a "500 internal server error" after that then your server does not support this option via .htaccess so remove that line.If you cannot do it that way then you would need to edit "/config/config.inc.php" and add at the top by the other ini_set() calls this:@ini_set(‘memory_limit’, ‘64M’);If you are on a Windows based host, for what it is worth you have my sympathies.=)Cheers Link to comment Share on other sites More sharing options...
funnyside Posted September 6, 2009 Author Share Posted September 6, 2009 The .htaccess doesn't show in file manager but in filezilla it's 0KB so there's nothing to edit. I added the line to the config.php but still same error. Link to comment Share on other sites More sharing options...
codegrunt Posted September 6, 2009 Share Posted September 6, 2009 Create a new script (call it something unique and give it a ".php" extension) and put this in it:<?phpini_set(‘memory_limit’, ‘64M’);phpinfo();?>Then call that page in your web browser. Search for "memory_limit". If it says anything less than 64M then your web host will not allow you to change the default memory limit.Who is your web host? Also some sites like GoDaddy for example cache .htaccess files so it can take a bit before changes take effect.Cheers Link to comment Share on other sites More sharing options...
funnyside Posted September 6, 2009 Author Share Posted September 6, 2009 I use meekhost.comI uploaded it but i'm getting an errorhttp://fsolent.hawster.com/memory.php Link to comment Share on other sites More sharing options...
codegrunt Posted September 6, 2009 Share Posted September 6, 2009 For security reasons it is best if you make up the name yourself and do not give it out (and delete the file when you are done). Anything as long as it ends with ".php" and that does not already exist will work ("1234.php" for example). Upload it to your web root, i.e. the same level as where your store's "index.php" file is located.Then call it in your web browser:http://www.funnysides-website.com/1234.phpThis will show the PHP settings for your webhost.If you can't change the value try posting to the meekhost support forums asking how to bump up the memory limit for PHP.You still have not said though whether no image resizing works or whether a really small image makes it through the resizing process OK.Cheers Link to comment Share on other sites More sharing options...
funnyside Posted September 6, 2009 Author Share Posted September 6, 2009 Resizing worked lol Link to comment Share on other sites More sharing options...
Recommended Posts