Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4282
Latest: Eric87
New This Month: 7
New This Week: 1
New Today: 1
Stats
Total Posts: 43660
Total Topics: 7574
Most Online Today: 89
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 44
Total: 44

Author Topic: Fatal error uploading image  (Read 5490 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: 16617
    • 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: 16617
    • 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: 16617
    • 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
6731 Views
Last post August 23, 2007, 07:20:24 pm
by rumboogy
3 Replies
4727 Views
Last post March 18, 2008, 01:14:14 pm
by clive
5 Replies
6985 Views
Last post May 07, 2009, 08:13:45 pm
by SMFHacks
1 Replies
4331 Views
Last post May 31, 2009, 08:45:20 pm
by SMFHacks
4 Replies
4209 Views
Last post March 03, 2015, 01:40:32 pm
by kgirlsusa

+- Recent Topics

Do you offer paid assistance with the SMFBlog mod? by Grammy
February 11, 2025, 02:58:04 pm

SMFBlog Mod by Grammy
February 10, 2025, 07:33:32 pm

[Mod]Bluesky Auto Embed by SMFHacks
January 30, 2025, 01:47:36 pm

Delete a Picture from Trash - Error by SMFHacks
January 29, 2025, 09:06:38 pm

RESOLVED: Store Not Logging Transactions or Sending Emails by SMFHacks
January 23, 2025, 06:24:27 pm

Ability to exclude categories from ezPortal SMF Gallery random image ezblock by Alistair
January 22, 2025, 08:20:13 am

How to move SMF to new server by SMFHacks
January 21, 2025, 08:45:53 pm

Figuring out settings by SMFHacks
January 12, 2025, 04:56:14 pm

Filesizes incorrect by SMFHacks
January 12, 2025, 02:02:47 pm

December 2024 Sale! by SMFHacks
December 02, 2024, 10:30:38 pm

Powered by EzPortal