Jump to content

[Resolved] Admin - Images (File manager) HTTP ERROR 500


PeteM

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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? 

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...