Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate  (Read 4661 times)

0 Members and 1 Guest are viewing this topic.

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar

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:

Quote
Fatal 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?
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page

Take a look at the documents: Upload Troubleshooting

To quote:
Quote
It'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.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar

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.
Logged

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar

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.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page

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.
Quote
Fatal 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

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026

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
Logged

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar

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:

Code: [Select]
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
Logged

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar

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.
Logged

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar

Attaching debug info.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.