Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Unexpected token - in uploading attachments
Avatar
AriM
Member
sp_UserOfflineSmall Offline
Sep 24, 2014 - 5:22 am

Suddenly, the forum stopped shrinking attachment images. An "Unexpected token" error is shown and after that: 

Error 999 - Unknown server error (check image size - may be exhausting memory)

Basically, nothing has been touched - that I know of.screenshot.1.jpgImage Enlarger

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Sep 24, 2014 - 7:32 am

Hey Ari,

Can you elaborate when you say the forum has 'stopped shrinking' attached images? Is this happening on all attachments, or just recent ones?

Error 999 – Unknown server error, just means that something went wrong. Unfortunately the error is not very descriptive! But it might be worth taking a look in the server error log if you have access. Could possibly be that the temp folder needs emptying also..

Avatar
AriM
Member
sp_UserOfflineSmall Offline
Sep 24, 2014 - 9:31 am

I did some testing. It seems that when the original image size approaches 5 Mb, the transfer fails. 4 Mb goes through without problems. I don't know where the exact line goes. It's possible that the images that I have tested and downloaded earlier are those under 5 Mb. 

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Sep 24, 2014 - 10:59 am

In the first post you said it had stopped 'shrinking' attachments, but now you're saying that the upload fails completely?

Did you manage to have a look at the server error log?

Avatar
AriM
Member
sp_UserOfflineSmall Offline
Sep 24, 2014 - 2:10 pm

It seems that I need more PHP space

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Sep 24, 2014 - 3:14 pm

Where do you need more PHP space exactly? Did you manage to get any useful errors?

Avatar
AriM
Member
sp_UserOfflineSmall Offline
Sep 24, 2014 - 3:59 pm

I was hoping you would know where and how much I need more memory. Php.ini?  I'm not sure if my host allows to allocate more memory. 134 Mb is quite a lot?

How much memory exactly is needed to resize uploaded images. It's not uncommon to see some 12 Mb image files.

How about that other error, missing argument in sp-forum-support-functions.php on line 552? Where does it come from?

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Sep 24, 2014 - 5:19 pm

Sorry, must have missed the attachment there!

Well if you have access to your PHP.ini file on the server, then you can adjust the default memory limit pretty easily, if you don't have access, you will probably have to ask your host for assistance..

I'm not entirely sure that's the problem, but it's definitely a good place to start. 5mb isn't huge for an image and I think the max PHP limit is something like 25mb, but if you are running a lot of plugins, I suppose one possibility is that you are sitting just on the boundary of the limit, and anything over 5mb is exceeding it..

The other error isn't an error, just a warning and can be ignored.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 24, 2014 - 7:19 pm

12MB image?  very large...  yes, cameras take them quite large but for majority of websites, images of that size and resolution cant really be shown to benefit...  think we limit uploads here to 100k... different purposes of course from say a photography forum... 

and its always much better to resize before uploading since you wont show them at the resolution anyways...

but yes, its a php intensive process in the php GD or imagicmagic libraries... its not really simple press...  if you are uploading large MB images, you will need lots of memory to process it... or just dont resize..

Avatar
AriM
Member
sp_UserOfflineSmall Offline
Sep 25, 2014 - 5:13 am

Thank you for your answers.

The max php size on my server is currently a fixed 128Mb. It allows to compress images under 5Mb. The php memory can be increased by paying for a dedicated server for a considerable extra cost. 

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620