Recent Posts
- (09/10) Fixing Warning: the ECDSA host key for 'github.com' differs from the key for the IP addressTAGS:Web Server Admin
- (12/26) CakePHP 3 - Getting List of Column Definitions from a Table (like schema())TAGS:CakephpCake3
- (09/14) Change Order of Loaded Behaviors in CakePHP 3TAGS:Cake3CakephpWeb ProgrammingPhp
- (05/29) CakePHP 3 - Accept JSON Header Only Working When Debug FalseTAGS:Web ProgrammingCakephpCake3
- (05/23) Remove All Events from Google Calendar (Reset Calendar)TAGS:Web ProgrammingPhp
- (11/08) Google Tag Manager (GTM) Not Firing Default PageView EventTAGS:Web ProgrammingJavascriptGoogle Tag Manager
- (10/13) In PHP, how do you get __toString() Magic Method Result without calling echo?TAGS:CakephpCake3Cakephp 13PhpWeb Programming
- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
Subscribe to my feed
MainelyDesign.com Blog
Making PHP File Uploads Work For Large Files
Posted on 06/18/2013 at 01:01 pm by Kevin Wentworth
Viewed 19,495 times | 0 comments
Get PHP File Uploads Working
The first trick to having any user contributed content these days is to get PHP File Uploads working (especially with big files). Our configuration we use for our Wamp local development and on our Linux server is below.
When managing file uploads to a server, there seems to be a lot of confusion regarding optimized PHP settings and configuration. We have had some experience with this that we would like to share.
We'll cut to the chase. Verify the following settings in your PHP configuration.
file_uploads ON
memory_limit 128M (optimize for your server capability)
upload_max_filesize 50M (tailor to your needs)
post_max_size (needs to match upload size)
A number of comments and blogs that we see suggest that max_input_time and max_execution_time may have been a limiting factors, we have not been able to resolve issues by increasing these beyond the default values of 60 and 30 seconds respectively.
Know also that developers may set memory limits and timeouts dynamically within the application.
ini_set('memory_limit','128M');
set_time_limit(0); /* time in seconds or zero to disable timeout */
In CPanel the post_max_size setting is accessed in Advanced PHP configuration.
Tags for Making PHP File Uploads Work For Large Files
Php | Web Server Admin | Web Programming | Usage | Cakephp | Wamp
Comments for this Posting
No comments. Be the first to post a reply.
Sorry, comments are closed for this posting.
Please Email Kevin if you have any questions. Thanks!