Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4229
Latest: Ghost
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43080
Total Topics: 7493
Most Online Today: 57
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 30
Total: 30

Author Topic: Fatal error uploading image  (Read 4339 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: 16356
    • 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: 16356
    • 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: 16356
    • 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
5130 Views
Last post August 23, 2007, 07:20:24 pm
by rumboogy
3 Replies
3927 Views
Last post March 18, 2008, 01:14:14 pm
by clive
5 Replies
5810 Views
Last post May 07, 2009, 08:13:45 pm
by SMFHacks
1 Replies
3578 Views
Last post May 31, 2009, 08:45:20 pm
by SMFHacks
4 Replies
3182 Views
Last post March 03, 2015, 01:40:32 pm
by kgirlsusa

+- Recent Topics

Version 6.1.6 issues by SMFHacks
September 30, 2023, 07:54:52 am

Follow / Follower Mod? by SMFHacks
September 23, 2023, 08:44:44 am

Looking for a good video player by replayuk
September 23, 2023, 12:17:39 am

[Mod]Discord Web Hooks by SMFHacks
September 22, 2023, 03:57:28 pm

SMF 2.1.4 Search by Anmer
September 22, 2023, 01:55:15 pm

Error in thise mode by Ghost
September 15, 2023, 08:42:24 am

Gallery Selection List Order by mickjav
September 07, 2023, 12:46:31 pm

[Mod]Tidy Child Boards 2.0 by Norwinjose
September 02, 2023, 11:42:54 am

PrettyUrls SEO Pro: Unable to submit sitemap to google search conmsole by SMFHacks
August 31, 2023, 10:55:22 am

PrettyURL - SEO4SMF Rewrites? by SMFHacks
August 28, 2023, 06:35:33 pm

Powered by EzPortal