Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 184
Total: 184

Author Topic: Fatal error uploading image  (Read 5113 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: 16436
    • 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: 16436
    • 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: 16436
    • 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
6341 Views
Last post August 23, 2007, 07:20:24 pm
by rumboogy
3 Replies
4566 Views
Last post March 18, 2008, 01:14:14 pm
by clive
5 Replies
6675 Views
Last post May 07, 2009, 08:13:45 pm
by SMFHacks
1 Replies
4174 Views
Last post May 31, 2009, 08:45:20 pm
by SMFHacks
4 Replies
3930 Views
Last post March 03, 2015, 01:40:32 pm
by kgirlsusa

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal