Hai Truong IT
Hai Truong IT

Reputation: 4187

Error when upload file size > 5MB in php?

I had uploaded file size >5MB and config in php.ini

php.ini

But when upload file is result error File Error size ini, how to config it!

Upvotes: 3

Views: 2610

Answers (2)

ryuusenshi
ryuusenshi

Reputation: 1986

There are, in fact, three additional configuration entries you should worry about in this case.

Two PHP configuration options control the maximum upload size: upload_max_filesize and post_max_size. Both can be set to, say, “10M” for 10 megabyte file sizes.

However, you also need to consider the time it takes to complete an upload. PHP scripts normally time-out after 30 seconds, but a 10MB file would take at least 3 minutes to upload on a healthy broadband connection (remember that upload speeds are typically five times slower than download speeds). In addition, manipulating or saving an uploaded image may also cause script time-outs. We therefore need to set PHP’s max_input_time and max_execution_time to something like 300 (5 minutes specified in seconds).

Source: http://www.sitepoint.com/upload-large-files-in-php/

Upvotes: 3

poncha
poncha

Reputation: 7866

There is another configuration entry that affects this behavior: post_max_size

Upvotes: 3

Related Questions