Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: No further photos can be added to an album - batch add and http upload fails  (Read 17651 times)

0 Members and 1 Guest are viewing this topic.

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

Until last week it was no problem to add new pictures to my coppermine albums.
But since monday I get errors.
Now, I followed the steps of the troubleshooting guide:
http://documentation.coppermine-gallery.net/en/upload_troubleshooting.htm

and I get the following error message:

Code: [Select]
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24848 bytes) in /var/www/vhosts/web690.c1.webspace-verkauf.de/html/coppermine/include/picmgmt.inc.php on line 437
Is the upload problem caused by my web hosting provider?
Or is it an configuration problem of my coppermine settings?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

 Fatal error: Allowed memory size of X bytes exhausted: http://forum.coppermine-gallery.net/index.php/topic,76445.0.html

upload erorr when I upload big images: http://forum.coppermine-gallery.net/index.php/topic,75099.0.html

I had the same problem when I was at Yahoo host. They have a limit.

Please use search before asking a question :)
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

I forgot.
Maybe you have access to php.ini on your host to change the memory limit.
Look in your host Cpanel or contact you host.
You can even ask them if you have limits.
Logged

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

No, my web hosting contact wrote, the the upload_max_filesize ist limited to 64 MB.
So, why does it not work by loading the pictures into the database?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

Your error talks about memory limit. In the firts link I posted in reply#1 I talk about memory limit.
Memory limit is important. You can have upload_max_filesize limited to 64 MB, but if the memory limit is something like 64M, then you will get that error.

Do you have access to php.ini on your host? Should be in your Cpanel. Most host allow to edit php.ini.
Yahoo host did not.
php.ini has the memory limit settings, upload_max_filesize etc.

If not then create a new file in your gallery folder. Name it phpinfo.php.
Open it and paste this code:

Code: [Select]
<?php phpinfo(); ?>

Save it.

In your browser (firefox, chrome etc) type your_gallery_adress/phpinfo.php

This will show you all your php settings. No need to contact the host again. See attachmennt phpinfo1.jpg.
Look for memory limit (see attachment phpinfo2.jpg).

Please tell me the values. In my screenshot is 150M.
Logged

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

Thanks a lot for your help with my investigations.

There is already a phpinfo.php file in my gallery folder on the web server.
Shown PHP Version 5.3.28. And here are the other results:

Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

Let's translate your error: allowed memory size of 134217728 bytes exhausted (tried to allocate 24848 bytes) = allowed memory size of 128M exhausted (tried to allocate 0.023696899M ). You can use a converter from bytes to mebibyte. Type bytes in mb in Google Serach and should show google converter (see attachment). From the dropdown menu choose bytes and mebibyte (M). Megabyte is MB.

Your error says that you exhausted the 128M memory limit you have. For that image you uploaded when you got that error you need other 0.023696899M. For that image 128M memory limit was not enough. For every image the error will tell you how much you still need.

You can insist to find a solution, but even the coppermine docs says that this error is about the memory limit. It can not be something else. Is nothing you can do.

You did not answer one of my questions: Do you have access to php.ini on your host?
You have to edit php.ini. In phpinfo.php file find Loaded Configuration File that shows you where is php.ini in your file manager, but you should have PHP Setting in your Cpanel somewhere to find it easier. Ask the host if you can edit php.ini if you don't find it.

If your host restricts their users to edit php.ini then ask them to increase at 150M.
On my localhost (I installed php and server on PC) I have 150M.
On my host I have by default 200M. I never have to edit it, but I am allowed to edit it.

If you can't edit php.ini and the host won't do it for you, then the only way is this:
http://forum.coppermine-gallery.net/index.php/topic,76445.0.html but may not work on your host.

Another way is to make the image smaller with a photo editor, then use filezilla to overwrite the image on the server with the big image. Then you have to use coppermine Admin Tools to update thumbs (when you hove over the thumb will show the size of the image you uploaded with coppermine upload. need to update after overwrite to refresh image size ) .
If you have users then that's a problem. Only you can accesss the server with FileZilla.

I'm sorry but is no other way around it when you have this error. I'm sure of that.

« Last Edit: December 06, 2014, 01:35:27 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

Another way is to always optimize you images with a photo editor (ex: photoshop has option Save for web to reduce image size, not image resolution, without loosing quality). Adobe photoshop is not free.  Gimp is one of the free editors I know that's similar to photoshop.
Ex: From 1.5MB to 800kb.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

If your host does not allows editing php.ini, then they proabibly do not allow .htaccess for hotlinking and other things that in time you will need.
Better to change host soon before you have a bigger gallery.
« Last Edit: December 06, 2014, 02:06:40 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

The error points to coppermine/include/picmgmt.inc.php on line 437 because there is the code to create images on upload "$src_img = imagecreatefromjpeg($src_file);"  or line 439 "$src_img = imagecreatefrompng($src_file);"  that can not execute because he needs you to allocate him more memory (increase php memory limit in php.ini). I assume he points to another line in some cases depending on your coppermine settings. What I am trying to say is that even if the error shows picmgmt.inc.php it does not means is an error there. Is not a coppermine error.
« Last Edit: December 09, 2014, 01:06:51 pm by allvip »
Logged

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

You did not answer one of my questions: Do you have access to php.ini on your host?

Sorry, I was a bit tired today in the morning. So I forgot to answer.
I was asking my web hosting provider, if I can raise the memory limit to 150M, but didn't get an answer so far.

The mentioned php.ini file ist located here on the web server:
/usr/local/php5328-cgi/etc
Unfortunately I can't access this folder.
Logged

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

My web hosting provider says again, they allow only an upload_max_filesize of 64M (converted about 67 MB).

They don't lose a word if the error is caused by the value memory_limit of 128M (about 134 MB) in the php.ini.

But I think, even 64M should be enough to handle a picture with a size of about 12 MB in the file system. Or is the real size much bigger and I cannot see this?
Logged

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

Now, I set the Maximum size for file upload (Maximalgröße für das Hochladen von Dateien) of 134217 KB in coppermine and chose the option Automatically resize pictures which exceed this file size (Automatische Verkleinerung von Bildern, die die Maximalgröße überschreiten): Yes, all (user + admin).
But it still doesn't work.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

Now, I set the Maximum size for file upload (Maximalgröße für das Hochladen von Dateien) of 134217 KB in coppermine and chose the option Automatically resize pictures which exceed this file size (Automatische Verkleinerung von Bildern, die die Maximalgröße überschreiten): Yes, all (user + admin).
But it still doesn't work.

Automatically resize pictures which exceed this file size DOES NOT EXIST in coppermine config.
Is Auto resize images that are larger than max width or height

See attachment
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

My web hosting provider says again, they allow only an upload_max_filesize of 64M (converted about 67 MB).

With 134217 KB = 128M in Config - Max size for uploaded files you past over upload_max_filesize of 64M, but is not important. Images are usually smaller then 64M.

They don't lose a word if the error is caused by the value memory_limit of 128M (about 134 MB) in the php.ini.

You don't need to ask them if is caused by memory limit. They don't want to talk about it and you should of ask them if you can edit it or if they can edit it.
In reply#6 I translate your error. Every image that will give you "Fatal error: Allowed memory size of..." will tell you how much it still needs. I'M SURE IS THE MEMORY LIMIT

But I think, even 64M should be enough to handle a picture with a size of about 12 MB in the file system. Or is the real size much bigger and I cannot see this?

upload_max_filesize is how big a file can be.
memory_limit is how much server memory will use to upload or resize a file (image, video etc).
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

Now, I followed the steps of the troubleshooting guide:
http://documentation.coppermine-gallery.net/en/upload_troubleshooting.htm

Did you tryed changing GD to ImageMagick. I think Image Magick consumes less memory on resize. GD and ImageMagick are for resizing only ( create thumbnails, Create intermediate pictures and Auto resize images that are larger than max width or height ). Will proabibly help.
I think Image Magick makes lower quality images.

See attachment.

Quote from my first reply that you ignored:
Fatal error: Allowed memory size of X bytes exhausted: http://forum.coppermine-gallery.net/index.php/topic,76445.0.html

Please try this to overwrite your server memory limit from 128M to 150M (use 200 or more if is still not working).

In phpinfo.php will still show 128M, but will actually trick the server and use 150M.

PLEASE TRY to read all my replies  and apply all my solutions.
If you will try it and will work then you will be sure the problem is the memory limit.
Let's hope your host can be tricked.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

You shoud have in yuor control panel PHP configuration or  PHP Settings or something like this.
Depends what kind of control panel your host installed. Just click all the tools, buttons etc  until you find it.


Demo CPanel X with PHP configuration tool: http://x3demob.cpx3demo.com:2082/cpsess150110528/frontend/x3/index.html?post_login=59609434646239. Clicking on PHP settings takes you to: http://x3demob.cpx3demo.com:2082/cpsess150110528/frontend/x3/php/index.html?lang  or see attachments.

In the demo the memory limit is not editable, but on a host, you can change the values.

I have a diffrent one with PHP Settings tool: see attachment.

I'm sure you don't have that. Your host would of told you to go and edit it yourself.

or in File Manager folder home/your_user_name/ or something like this.
« Last Edit: December 08, 2014, 03:58:16 pm by allvip »
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me

Let's go back to basics first. Please setup a user account that we can test uploads to and also set single file uploads as outlined in the docs. Once you have that setup please post a link to your site including the logon details for the user account but test it first logged on as that user to make sure all permissions are correctly set. It will allow us to check a few things before we get in too deep in server side problems, just to make sure.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Mate Matic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28

Automatically resize pictures which exceed this file size DOES NOT EXIST in coppermine config.
Is Auto resize images that are larger than max width or height

Ah, I've mixed it up. Thanks for your hint.


Did you tryed changing GD to ImageMagick.

Yes, I did. It works after my web hosting provider activated Image Magick in the server's PHP settings.
But I needed to ask him to do this before.
This solved my problem.
Bow, big pictures will be resized and the upload process in coppermine works fine.

allvip, thank you so much for your helping approaches.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362

It work fine now because ImageMagick is not limited by PHP memory limit but creats much bigger file size that uses much more server resourses. See attachment from Reply #13 to see where in Config is GD and ImageMagick.

GD: uses less server resources , lower file size, lower image quality but is limited by PHP memory_limit.
ImageMagick:  uses more server resources, much bigger file size (double), better image quality and is not limited by PHP memory_limit.

Read here: Advantages: ImageMagick versus GD :   http://forum.coppermine-gallery.net/index.php?topic=34098.0

ImageMagick vs GD vs Photoshop (quality and size): https://foliovision.com/2010/03/imagemagick-vs-gd
Photoshop is a photo editor.

With ImageMagic you will have bigger file size even for thumbnails wich will use more the server resources.
Server resources: CPU time and MySql time. They are very,very important on every server not just on shared server (host). The host can say that you gallery is too big and buy a bigger plan.
Every time your users load (view) pages with an image (images for the thumbnails page), the bigger the images are, the more CPU and MySql time is using.
On my shared host CPU time is limited to 100 minutes and MySql time is limited to 20 minutes.
Also on my host control panel I have the Resources button (tool) that shows be how much cpu and mySql time I use every day. This way I can check if I past the limits.

Conclusion:
1) Better to have smaller file size for intermediate image and thumbnails. The image quality is not important.
2)  For the uploaded image the quality is important. The real uploaded image (that shows in pop up when you click the image) will not be resized so it won't loose quality .Wil be resized (so will loose quality) only if is bigger then Max width and height for uploaded images set in coppermine config.
3) If you have many visitors you will have high CPU and MySql time.
4) Better to us GD and have more PHP memory limit so please use the firts link in reply#1.


PLEASE, 1000 please try the fix from the first link in reply#1 and GD. Even if ImageMagick is OK for you, I just want to know if it works for you to make your PHP memory limit bigger.

« Last Edit: December 12, 2014, 01:01:56 pm by allvip »
Logged
Pages: [1] 2   Go Up
 

Page created in 0.03 seconds with 20 queries.