Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate
 

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 of 536870912 bytes exhausted (tried to allocate

Started by Hanna., March 14, 2023, 03:39:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hanna.

Hey guys. I came across an old thread on this (version 1.3 and below.) I'm currently running version 1.6 and getting this error.

My image is not even 1Mb. My php ini is 2040Mb so I just don't understand what the deal is. I'm trying to upload 1 image, size 3000x2000px. Error receiving:

QuoteFatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes) in /home/public_html/include/debugger.inc.php on line 111

Could this be related to anything else than the memory limit? What am I missing?

Joe Carver

Take a look at the documents: Upload Troubleshooting

To quote:
QuoteIt's not the size of the file that matters here; it's the number of pixels that determine memory use in GD.

There are solutions that you can try.

Hanna.

Quote from: Joe Carver on March 14, 2023, 04:09:18 PM
Take a look at the documents: Upload Troubleshooting

To quote:
There are solutions that you can try.

Thanks.

This still doesn't make any sense. I already uploaded way bigger images without issues. Some images are over 1Mb and 4500px. This is the first time I'm seeing this error in years.

Hanna.

I had to go down to 600px to get one image uploaded. Then I replaced it via FTP to bigger and ran the Admin tools. This is just bizarre though.

Joe Carver

Check with your host and/or maybe look at your cPanel  to see what physical memory is available when you are uploading.

No issue seen on a test of a 4368x2312px (5.3Mb) file uploaded via HTML5 as well as others on CPG 1.6.22.

On second look, there is definitely something wrong in the numbers that your error message showed.
QuoteFatal error: Allowed memory size of 536870912 bytes exhausted

That might indicate by itself that the problem lies elsewhere and has used up the memory on the server before you tried uploads.

ron4mac

Uploading files should really have nothing to do with what theme is being used at the time of upload but, unfortunately, the way the core of CPG was designed, a lot of stuff about the theme comes into play even during an upload. If the theme is a complex one with added actions, it may needlessly use some of the PHP memory in the upload process. So you might try doing uploads with a lightweight theme. Do you know the trick of temporarily using a different theme, Hanna?
<MY-GALLERY>/index.php?theme=water_drop
That will cause your current browser to use that theme until it is reset.
<MY-GALLERY>/index.php?theme=xxx

Hanna.

Quote from: ron4mac on March 15, 2023, 10:04:25 PM
Uploading files should really have nothing to do with what theme is being used at the time of upload but, unfortunately, the way the core of CPG was designed, a lot of stuff about the theme comes into play even during an upload. If the theme is a complex one with added actions, it may needlessly use some of the PHP memory in the upload process. So you might try doing uploads with a lightweight theme. Do you know the trick of temporarily using a different theme, Hanna?
<MY-GALLERY>/index.php?theme=water_drop
That will cause your current browser to use that theme until it is reset.
<MY-GALLERY>/index.php?theme=xxx

Just saw this now. Yes, indeed I tried this method. I am not even trying to upload big stuff (max 2048px) and all I get is:

Fatal error: Uncaught TypeError: readdir(): Argument #1 ($dir_handle) must be of type resource or null, bool given in /public_html/searchnew.php:238 Stack trace: #0 /public_html/searchnew.php(238): readdir() #1 /public_html/searchnew.php(394): getfoldercontent() #2 /public_html/searchnew.php(570): CPGscandir() #3 {main} thrown in /public_html/searchnew.php on line 238

Hanna.

I went through the stub (https://forum.coppermine-gallery.net/index.php/topic,79013.0.html), deactivated all plugins and theme (now running theme water_drop) and still getting this error.

Hanna.