Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)

[#5919] where to increase memory which is needed for upload

8 years 8 months ago - 8 years 8 months ago #280662 by erichburkhard
I use Joomla 3.5.x CB 2.x / CB Gallery plugin 1.0.5 ....In the CB configuration the max upload file size is set to: 5 MB....but if I try to upload images which are approx. > 2MB the following message appears:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 31961089 bytes) in <span>/</span>home<span>/</span>www/web180/html/joomla/pre_production/libraries/CBLib/Imagine/Gd/Image.php on line 617

I already talked to my hoster: They said they cannot increase the corresponding memory Limit which is responsible for this

Question: Is there an other option ? ...e.g. a certain configuration of CB Gallery in order to lower the 'memory hunger' of CB Gallery plugin?

regards
Last edit: 8 years 8 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
8 years 8 months ago - 8 years 8 months ago #280695 by krileon
You're trying to upload an image with more than 2mb of compressed pixel data. Uncompressed it becomes something like 12mb. An image is uncompressed to raw bytes during processing. You can improve this performance by using ImageMagick instead of GD2 (slow and bad performance).

With Joomla, CB, and anything else installed you are likely using at least half of your 128mb memory limit. Possibly more depending on what else is installed. Add in processing of the image and it's possible to hit that limit pretty quickly.

Part of this issue is due to how the Imagine library handles thumbnails though. I've added a bug ticket to look into it further and see if some of the memory usage can be reduced.

For now only things I can suggest is accept smaller images only, increase memory limit, reduce memory usage globally on your site (uninstall stuff), or try using ImageMagick.

Please note however that no matter what the larger the image the more memory it will take to process. Also to keep in mind it's not exactly the filesize that's the issue, but often the dimensions of the image. For example a 3000x3000 image has a lot of pixel data.

forge.joomlapolis.com/issues/5919


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 8 years 8 months ago by krileon.

Please Log in or Create an account to join the conversation.

8 years 7 months ago #281254 by erichburkhard
Replied by erichburkhard on topic where to increase memory which is needed for upload
my environment: Joomla version 3.5.1 / CB 2.0.14 / CBSubs 4.0.1

....because of your hint I tried to use "ImageMagick" instead of "GD" library

For this reason the hoster installed PHP 5.6.x for me....then I was able to choose the 'Image Magick' component inside Community Builder config tab....then I tried to upload a small image ....but the following message appeared:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, support@hoststar.ch and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log."

I tried to debug the system (via global configuration) but there was still the same reaction of the system....

...then I contacted my hoster....they installed the following php-script in my environment and started it:

<?php

error_reporting(E_ALL);
ini_set( 'display_errors','1');

/* Create a new imagick object */
$im = new Imagick();

/* Create new image. This will be used as fill pattern */
$im->newPseudoImage(50, 50, "gradient:red-black");

/* Create imagickdraw object */
$draw = new ImagickDraw();

/* Start a new pattern called "gradient" */
$draw->pushPattern('gradient', 0, 0, 50, 50);

/* Composite the gradient on the pattern */
$draw->composite(Imagick::COMPOSITE_OVER, 0, 0, 50, 50, $im);

/* Close the pattern */
$draw->popPattern();

/* Use the pattern called "gradient" as the fill */
$draw->setFillPatternURL('#gradient');

/* Set font size to 52 */
$draw->setFontSize(52);

/* Annotate some text */
$draw->annotation(20, 50, "Imagick works!");

/* Create a new canvas object and a white image */
$canvas = new Imagick();
$canvas->newImage(350, 70, "white");

/* Draw the ImagickDraw on to the canvas */
$canvas->drawImage($draw);

/* 1px black border around the image */
$canvas->borderImage('black', 1, 1);

/* Set the format to PNG */
$canvas->setImageFormat('png');

/* Output the image */
header("Content-Type: image/png");
echo $canvas;
?>

...the following result was prompted to my screen: "Imagick works!"

...as an advise the hoster told me to check (with Joomlapolis.com) if my components (my main components are Joomla / CB / CB-Subs / 2 components from Akeeba) is running with PHP 5.6? ....my question: causes the PHP version this problem

regards

________________________________________
Apache Server at web180.login-94.hoststar.ch Port 80

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
8 years 7 months ago #281259 by krileon
Enable debug mode and maximum error reporting in Joomla global configuration. Once done attempt to upload and see if any fatal errors are output. If none then check server error log to see if any are preset.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

8 years 7 months ago - 8 years 7 months ago #281261 by erichburkhard
Replied by erichburkhard on topic where to increase memory which is needed for upload
So the activation of the maximum debug level had no effect...no fatal error ...If I upload (even a small image) the message as described before appears (PS: if I start the web-presentation (without uploading) the following warning appears:

"Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in <span>/</span>home<span>/</span>www/web180/html/joomla/pre_production/libraries/joomla/http/transport/curl.php on line 182"

...but I think this is harmless ...ins't it?

...about which server-log-file are you talking about....is it the file which path is set here ? --> Backend: Global configuration --> System -> Path to log Folder? ...here is absolutely no new entry....

but I noticed the following: When I upload an image, the described message appears: "Internal Server Error..." ...if I do now a refresh with the browser the following appears:


File Attachment:

File Name: error_message.pdf
File Size:198 KB


is this may be a hint ?
Attachments:
Last edit: 8 years 7 months ago by erichburkhard.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
8 years 7 months ago #281275 by krileon
That's coming from Joomla it self. CB doesn't use that API. Nor does uploading in CB Gallery use cURL. Quick searching shows that's likely related to Joomlas RSS feed module. Below is a post regarding that warning.

forum.joomla.org/viewtopic.php?f=707&t=802013

about which server-log-file are you talking about

Your hosts PHP error log. Contact your host on how to access it. If you've cPanel there's typically a menu icon to reach it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum