Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4260
Latest: Verrick
New This Month: 3
New This Week: 0
New Today: 0
Stats
Total Posts: 43301
Total Topics: 7525
Most Online Today: 105
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 88
Total: 88

Author Topic: Fatal error uploading image  (Read 5302 times)

0 Members and 1 Guest are viewing this topic.

guest3817

  • Guest
Fatal error uploading image
« on: September 22, 2009, 02:37:02 pm »
I am getting the following error uploading a 4415 by 3312 pixel 4.5mb jpg file as a normal member of my forum. The picture should be resized to 1024 by 768.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17664 bytes) in /home/hunter00/public_html/sisac/forum/Sources/Gallery2.php on line 5067

Should my users be able to upload and resize a picture of this size?

Thanks

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: Fatal error uploading image
« Reply #1 on: September 22, 2009, 06:58:15 pm »
A quick fix would be to
Open Sources/Gallery2.php
Find All
Code: [Select]
@ini_set("memory_limit","64M");
Change to
Code: [Select]
@ini_set("memory_limit","128M");
That would double the amount of memory used to resize the image.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

guest3817

  • Guest
Re: Fatal error uploading image
« Reply #2 on: September 23, 2009, 03:42:02 am »
Hi

Thanks for the quick response,

This moves where the error occurs the message is now

Code: [Select]
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17664 bytes) in /home/hunter00/public_html/sisac/forum/Sources/Gallery2.php on line 10133
I also tried resaving the picture using photoshop as a jpeg at a quality setting of 10 which left the size and resolution the same but reduced the physical size to 2mb and got the same error.

I also tried another large image ( from the same type of canon camera) and got the same result.

The problem is that most of my users are likely to have very little knowledge about how to resize images themselves. the user that is having the problem at the moment has no image processing software at all other than Window paint.

Thanks for any help you can give with this.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: Fatal error uploading image
« Reply #3 on: September 23, 2009, 07:26:52 am »
Did you replace all instances of 64mb in the file?
That line number in that error message seems high 10133 more than the lines of code in the file.

Other things you can check our the php settings on the server and what the default memory limit for scripts is.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

guest3817

  • Guest
Re: Fatal error uploading image
« Reply #4 on: September 23, 2009, 08:20:18 am »
Hi

I found four instances of

Code: [Select]
@ini_set("memory_limit","64M"); and replaced them with "128M". I just found one instance of

Code: [Select]
@ini_set("memory_limit","48M"); on checking just now so I've increased that to 128M as well

I'd got my ISP to increase memory server wide. cPanels PHP confuguration now shows  the following.

Resource Limits    max_execution_time        120
Resource Limits    max_input_time       300
Resource Limits    memory_limit       100M

I'm still getting the this error trying to upload large jpegs.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17664 bytes) in /home/xxx/public_html/xxx/forum/Sources/Gallery2.php on line 10133

Do you think the memory limit is high enough.

Doug

guest3817

  • Guest
Re: Fatal error uploading image
« Reply #5 on: September 23, 2009, 01:53:52 pm »
My ISP put the memory limit up to 150M but I was still getting the same error. On looking at the code again I found an occurence of @ini_set('memory_limit', '64M'); using single quotes rather than double quotes. Amending this to 128M has solved the problem. Thankyou once again for all your help.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: Fatal error uploading image
« Reply #6 on: September 23, 2009, 06:02:42 pm »
Glad you were able to get it working. I will probably change to 128mb for the next release. It is amazing though that php would use that much memory just to resize a 4 megabyte photo
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
6534 Views
Last post August 23, 2007, 07:20:24 pm
by rumboogy
3 Replies
4620 Views
Last post March 18, 2008, 01:14:14 pm
by clive
5 Replies
6755 Views
Last post May 07, 2009, 08:13:45 pm
by SMFHacks
1 Replies
4232 Views
Last post May 31, 2009, 08:45:20 pm
by SMFHacks
4 Replies
4013 Views
Last post March 03, 2015, 01:40:32 pm
by kgirlsusa

+- Recent Topics

Pretty Urls extras by SMFHacks
May 13, 2024, 10:28:54 am

Mod question by Verrick
May 11, 2024, 02:42:50 pm

i have paid but cant download ad pro. by SMFHacks
May 02, 2024, 11:29:38 pm

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

Powered by EzPortal