Jump to content

Recommended Posts

For some reason, uploads are taking up much more memory than the actual file size. For example, I tried to upload a 640K jpg and I set a memory limit per script of 12MB, and that file made the script go over the limit and it crashed. ???

Why are file uploads of 640KB making my script use up more than the 12 meg limit and crash? Is there any way to fix this, short of restricting the file size people can upload?

-Matthew
I don't know why, but I had the same problem, it's possibly a memory leak issue.

Add the following to the top of your page:

[code]
<?php
ini_set("memory_limit", "50M");
ini_set("max_execution_time", "120");
?>
[/code]

Regards
Huggie
Yes, but if I set the memory to 50M, wouldn't it crash my server (or at least bring it to its knees) if more than a few people were using it at the same time?

But in any case, it's not normal for a 512kb file to hog up over 12 megs of ram right?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.