Fatal Error: Allowed memory size exhausted (strange) Fatal Error: Allowed memory size exhausted (strange)
 

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]

Main Menu

Fatal Error: Allowed memory size exhausted (strange)

Started by Hanna., February 11, 2018, 07:29:28 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Hanna.

Hi everyone. I have been experiencing this fatal error of extending memory limit.

But I did increase it from 8 to 64M in the php.ini. Still it will not upload my pictures (selective ones) and I go with the GD version (best one.). My error message refers to the php file "imageobject_gd.class.php"

phill104

What size images are you trying to upload? It may simply be a case your images are quite large.
It is a mistake to think you can solve any major problems just with potatoes.

Hanna.

They are no bigger than the rest of the ones I am trying to get up. 3500px and less than 500 kb/each? That is what makes this error so strange.

ron4mac

Deselect Auto-orient image(s) when uploading a problem file to see if it makes a difference.

ron4mac

#4
Quote from: Hanna. on February 11, 2018, 07:29:28 PM
My error message refers to the php file "imageobject_gd.class.php"
Can you give us more of the error message? (line number?)

And can you check memory_limit from the Admin menu (Information->phpinfo) to see what the value is?

Hanna.

Quote from: ron4mac on February 12, 2018, 02:31:22 AM
Can you give us more of the error message? (line number?)

And can you check memory_limit from the Admin menu (Information->phpinfo) to see what the value is?

The fatal error is "Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in /home/minowncu/public_html/addons/sarahmichellegellar.us/gallery/include/imageobject_gd.class.php on line 403" and attaching the phpinfo. Let me know if you need anything else.


ron4mac

Hmm .. I don't immediately see why you should be having an issue. What upload method are you using?

I see this is a new site. Do you have a similar issue with the kristincavallari site? Perhaps you could try to upload one of the problem images there to see. If no problems at the KC site, what are the differences?

BTW .. I'm seeing the attached behavior at both sites. I have to click on the small bar and view the intermediate image before the other thumbnails show up. Also get a few browser console errors.

Hanna.

Quote from: ron4mac on February 12, 2018, 02:30:35 PM
Hmm .. I don't immediately see why you should be having an issue. What upload method are you using?

I see this is a new site. Do you have a similar issue with the kristincavallari site? Perhaps you could try to upload one of the problem images there to see. If no problems at the KC site, what are the differences?

BTW .. I'm seeing the attached behavior at both sites. I have to click on the small bar and view the intermediate image before the other thumbnails show up. Also get a few browser console errors.

Thank you for all observations. I just uploaded the fadeslideshow.js that was missing in my folders. Not sure what the coppermine.css is referring to error-wise?

And I did try to upload the same photos to Kristin and it gave me same fatal error. That must mean that the pictures have to have some sort of setting that is not accepted by Coppermine?

phill104

Not really, Coppermine doesn't really work like that. This certainly sounds more server related.

I have seen server setups, particularly in shared hosting, that while they allow you to make changes to the memory available and it appears this has been change, behind the scenes are quite low limits. The file used over 128mb of memory during the process hence the message. Is there somewhere you can upload the i,age so we can download it and see just how much it would actually take to process.
It is a mistake to think you can solve any major problems just with potatoes.

Hanna.

Quote from: Phill Luckhurst on February 12, 2018, 07:59:00 PM
Not really, Coppermine doesn't really work like that. This certainly sounds more server related.

I have seen server setups, particularly in shared hosting, that while they allow you to make changes to the memory available and it appears this has been change, behind the scenes are quite low limits. The file used over 128mb of memory during the process hence the message. Is there somewhere you can upload the i,age so we can download it and see just how much it would actually take to process.

I am going to request a report on it. All my others are at 64M according to mycpanel. I will be back with an update. Thank you.

Hanna.

Quote from: Hanna. on February 13, 2018, 12:10:16 AM
I am going to request a report on it. All my others are at 64M according to mycpanel. I will be back with an update. Thank you.

My providor responded "we have set to 256MB". I hope that helps.

Hanna.

Quote from: ron4mac on February 12, 2018, 02:30:35 PM
BTW .. I'm seeing the attached behavior at both sites. I have to click on the small bar and view the intermediate image before the other thumbnails show up. Also get a few browser console errors.

Would you have any idea how to fix this particular issue with the thumbnails not loading properly?

ron4mac

Quote from: Hanna. on February 14, 2018, 07:34:57 PM
Would you have any idea how to fix this particular issue with the thumbnails not loading properly?
The Kristin site seems to be running quite well now ... no thumbnail issues that I saw. I'll point out some things below that should be corrected, though.
The Sarah site still does not render well.

Your web pages should load without significant issues being displayed in the browser console .. which is the case with Kristin site right now.
The Sarah site shows a number of errors (see attached). You should correct those issues.

These:
<link rel="stylesheet" href="https://sarahmichellegellar.us/gallery/themes/2018feb/coppermine.css" type="text/css" />
<link rel="stylesheet" href="https://sarahmichellegellar.us/gallery/themes/2018feb/style.css" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

are better written like this:
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/coppermine.css" type="text/css" />
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/style.css" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

That way the browser will do the right thing whether it is http: or https:

CPG loads its own jQuery version so it is probably not a good thing to be loading a CDN version as well.
BTW .. the CPG version of jQuery being used is actually v1.4.4, even though it is labeled 1.4.2.

Hanna.

Quote from: ron4mac on February 14, 2018, 09:30:08 PM
The Kristin site seems to be running quite well now ... no thumbnail issues that I saw. I'll point out some things below that should be corrected, though.
The Sarah site still does not render well.

Your web pages should load without significant issues being displayed in the browser console .. which is the case with Kristin site right now.
The Sarah site shows a number of errors (see attached). You should correct those issues.

These:
<link rel="stylesheet" href="https://sarahmichellegellar.us/gallery/themes/2018feb/coppermine.css" type="text/css" />
<link rel="stylesheet" href="https://sarahmichellegellar.us/gallery/themes/2018feb/style.css" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

are better written like this:
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/coppermine.css" type="text/css" />
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/style.css" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

That way the browser will do the right thing whether it is http: or https:

CPG loads its own jQuery version so it is probably not a good thing to be loading a CDN version as well.
BTW .. the CPG version of jQuery being used is actually v1.4.4, even though it is labeled 1.4.2.

I just made those adjustments. If you have any more/other suggestions, let me know.

The solution, if you will, to this topic that I started on the fatal error -- I maximized the memory limit to above 200M just to upload certain files; then I put it back to 64M. Only setting that worked.

ron4mac

#14
Quote from: Hanna. on February 15, 2018, 02:06:06 AM
I just made those adjustments. If you have any more/other suggestions, let me know.

You've got some links set to cross over between your sites.
In your template.html files, change things like this:
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/coppermine.css" type="text/css" />
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/style.css" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

to this:
<link rel="stylesheet" href="css/coppermine.css" type="text/css" />
<link rel="stylesheet" href="{THEME_DIR}style.css" type="text/css" />


The correct location for the coppermine.css file distributed with the release is as above. That was changed many releases ago, I think.
CPG 1.6 will turn {THEME_DIR} in your template.html into the proper link to your theme, making your theme more portable.
And notice I did not include the jQuery CDN call ... get rid of that.

With regard to thumbnails, Kristin is working okay but not Sarah or Rachel. The difference I see is the FB script.
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

If you need to keep that, try moving it to the bottom of the template file, just before the </body> tag.
Or implement it in a manner as FB suggests when using jQuery:
<script type="text/javascript">
  $(document).ready(function() {
    $.ajaxSetup({ cache: true });
    $.getScript('https://connect.facebook.net/en_US/sdk.js', function(){
      FB.init({
        appId: '{your-app-id}',
        version: 'v2.7' // or v2.1, v2.2, v2.3, ...
      });     
      $('#loginbutton,#feedbutton').removeAttr('disabled');
      FB.getLoginStatus(updateStatusCallback);
    });
  });
</script>


I don't see any use of the fadeslideshow code.

phill104

Quote from: Hanna. on February 15, 2018, 02:06:06 AM

The solution, if you will, to this topic that I started on the fatal error -- I maximized the memory limit to above 200M just to upload certain files; then I put it back to 64M. Only setting that worked.

That is understandable. There is a good explanation of this error and the reasons behind it here - http://forum.coppermine-gallery.net/index.php/topic,24088.msg110690.html#msg110690

The thread may be a little out of date, but it does explain a little more.
It is a mistake to think you can solve any major problems just with potatoes.

Hanna.

Quote from: ron4mac on February 15, 2018, 02:16:46 PM
You've got some links set to cross over between your sites.
In your template.html files, change things like this:
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/coppermine.css" type="text/css" />
<link rel="stylesheet" href="//sarahmichellegellar.us/gallery/themes/2018feb/style.css" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

to this:
<link rel="stylesheet" href="css/coppermine.css" type="text/css" />
<link rel="stylesheet" href="{THEME_DIR}style.css" type="text/css" />


The correct location for the coppermine.css file distributed with the release is as above. That was changed many releases ago, I think.
CPG 1.6 will turn {THEME_DIR} in your template.html into the proper link to your theme, making your theme more portable.
And notice I did not include the jQuery CDN call ... get rid of that.

With regard to thumbnails, Kristin is working okay but not Sarah or Rachel. The difference I see is the FB script.
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

If you need to keep that, try moving it to the bottom of the template file, just before the </body> tag.
Or implement it in a manner as FB suggests when using jQuery:
<script type="text/javascript">
  $(document).ready(function() {
    $.ajaxSetup({ cache: true });
    $.getScript('https://connect.facebook.net/en_US/sdk.js', function(){
      FB.init({
        appId: '{your-app-id}',
        version: 'v2.7' // or v2.1, v2.2, v2.3, ...
      });     
      $('#loginbutton,#feedbutton').removeAttr('disabled');
      FB.getLoginStatus(updateStatusCallback);
    });
  });
</script>


I don't see any use of the fadeslideshow code.

I made those changes on the Sarah site. I still experience slow loading on the thumbnails on my phone for instance?

And...

Quote from: Phill Luckhurst on February 15, 2018, 08:44:33 PM
That is understandable. There is a good explanation of this error and the reasons behind it here - http://forum.coppermine-gallery.net/index.php/topic,24088.msg110690.html#msg110690

The thread may be a little out of date, but it does explain a little more.

Thank you!

ron4mac

#17
Quote from: Hanna. on February 16, 2018, 01:29:14 AM
I made those changes on the Sarah site. I still experience slow loading on the thumbnails on my phone for instance?
Yes, there are still image load issues. That leaves the Google ads script invocation as the next likely culprit. Try running without that (it's not at Kristin - which seems fine).
[edit:]
My mistake .. it is at Kristin.  You'll have to determine what is different between the Kristin site setup and the others. I have no problems loading pages with lots of thumbnails at Kristin. But there are definitely problems with that at the other sites.