/    Sign up×
Community /Pin to ProfileBookmark

memory_limit

What are the effects of setting a large (php_value memory_limit 16M) in your .htaccess file

Sometimes i get the follwing error: [B]Allowed memory size of 16777216 bytes exhausted (tried to allocate (some number) bytes)[/B] when i try to upload images to my site

If i increase (php_value memory_limit [B]16[/B]M) memory size in my .htaccess file, what effects will it have on the rest of my site/server

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@LeeUOct 09.2007 — I believe the memory changes should be done in your php.ini file, not .htaccess.
Copy linkTweet thisAlerts:
@WebnerdOct 09.2007 — The answer to the question is, the web server will eat up your system memory caching file uploads. If you have a high traffic site and allow 16MB uploads and you only have 512MB of RAM, then only 32 uploads can occur at a given time. This number however, is inaccurate as the server is already balancing the memory load with other services. So, you might only get 10 uploads at a given time, and then the server can possibly hang and/or crash.
Copy linkTweet thisAlerts:
@oo7mlauthorOct 09.2007 — Ok, so what can i do to stop this error, my hosting company does not give access to the php.ini file... So what should i do, what should i set the [B]memory_limit[/B] to. My users can only upload JPEGs that are less than 2mb in size
Copy linkTweet thisAlerts:
@felgallOct 09.2007 — Uploadinjg files bigger than a few hundred k in size using the PHP form upload option is extremely inefficient. For larger files you should be using the FTP extensions to PHP.

See http://php.net/ftp
×

Success!

Help @oo7ml spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...