PeteM Posted June 4, 2016 Share Posted June 4, 2016 Title says it all really. All other admin functions working but can no longer access the Images / File manager Admin screen to add and update images. Used to work fine but has mysteriously stopped working. Updated to latest version to see if that would help but has made no difference. Any idea how I can de-bug the issue? Thanks. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 4, 2016 Share Posted June 4, 2016 Welcome PeteM! Glad to see you made it to the forums. We would like to see PHP's error_log. If that does not show the reason, then maybe the web server's error log. If your hosting account's control panel does not reveal to you PHP's error log, then: Using a programmer's text editor (not a word processor), please create a file called ini-custom.inc.php, and have as its contents: <?php # Custom initialization commands # Filename: ini-custom.inc.php # File location: main CubeCart folder ini_set('memory_limit', '256M'); ini_set('max_execution_time', '60'); ini_set('error_log', 'error_log'); ini_set('log_errors', 'on'); ?> Place this file in CubeCart's main folder at your site. Your hosting control panel's set of tools may have an editor available. If the problem is with CubeCart, and you get the 500ISE, there should be a new file named error_log in the main folder. Quote Link to comment Share on other sites More sharing options...
PeteM Posted June 4, 2016 Author Share Posted June 4, 2016 Thanks Bill. I get the following in my error_log: [04-Jun-2016 16:12:44 Europe/London] PHP Fatal error: Out of memory (allocated 33030144) (tried to allocate 385 bytes) in /homepages/17/d72034191/htdocs/smartmarine/classes/gd.class.php on line 146 Pete Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 4, 2016 Share Posted June 4, 2016 Ok. "allocated 33030144" This tells me that your PHP is only getting about 32MiB to operate. Whereas, the commands in the file above is suppose to give PHP 256MiB. In admin, PHP info, scroll to the "Core" table and look for the "memory_limit" values. The value in the middle column is 'local value' (set by a local PHP.INI file, web server .htaccess directives, or PHP statements), and right column is the 'master value' (set by PHP's primary PHP.INI configuration). If the Core table shows you have 32MiB in the 'local value' column, then, as I understand it, there is a way to disallow any local changes to certain master values - perhaps this is such a case. Generally, CubeCart can operate at that memory limit, but when trying to work with images, where they can get really huge when PHP's GD image library decompresses already large JPG files, memory will get exhausted. Using FTP or your hosting control panel's File Explorer, look at the filesizes of images in /images/source/. Try to not have any file larger than 50K. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 4, 2016 Share Posted June 4, 2016 I have a huge image directory. Havenswift had temporarily moved me to a server that was set to 32MiB, and I reached the point that I could no longer export to Google. As soon as he increased the memory available, I was back in business. All of my images in source, etc., are optimized for web use and are 50k or less. Quote Link to comment Share on other sites More sharing options...
PeteM Posted June 5, 2016 Author Share Posted June 5, 2016 17 hours ago, bsmither said: Ok. "allocated 33030144" This tells me that your PHP is only getting about 32MiB to operate. Whereas, the commands in the file above is suppose to give PHP 256MiB. In admin, PHP info, scroll to the "Core" table and look for the "memory_limit" values. The value in the middle column is 'local value' (set by a local PHP.INI file, web server .htaccess directives, or PHP statements), and right column is the 'master value' (set by PHP's primary PHP.INI configuration). If the Core table shows you have 32MiB in the 'local value' column, then, as I understand it, there is a way to disallow any local changes to certain master values - perhaps this is such a case. Generally, CubeCart can operate at that memory limit, but when trying to work with images, where they can get really huge when PHP's GD image library decompresses already large JPG files, memory will get exhausted. Using FTP or your hosting control panel's File Explorer, look at the filesizes of images in /images/source/. Try to not have any file larger than 50K. Thanks. With the ini-custom.inc.php I get: memory_limit Local Value 256m memory_limit Core Value 256m When I remove the ini-custom.inc.php I get: memory_limit Local Value 128m memory_limit Core Value 256m Looking at my images, they are between 18kb and 300kb. Do you think I should compress them? Incidentally, all the equivalent images in the cache folder are less than <50kb. What are the source images used for, are they used in the store or just the source for the conversion to the images in the cache folder? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 5, 2016 Share Posted June 5, 2016 Image files, with the exception of one type (BMP), are already compressed. Please give consideration to running any image graeter than 50K in size through an image editor to reduce the dimensions of the image, such that the resultant filesize becomes less than 50K. I think the image(s) upwards of 300K must be extraordinarily wide and tall. CubeCart will display the source image to show when magnified. But, there is a reasonable size of 600 pixels on the longest side. CubeCart 5 started the process of taking the source image and rendering a variety smaller sizes from it. This was done (presumably) to make the images fit the spaces allotted in the layouts of the fixed width skins. Quote Link to comment Share on other sites More sharing options...
PeteM Posted June 5, 2016 Author Share Posted June 5, 2016 Bingo! I resized the largest image and uploaded it and it works perfectly now. Thanks for all you help, I really appreciate it. Enjoy the rest of your weekend. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.