1

What is the maximum file upload size allowed in the post_max_size and upload_max_filesize configuration options (in PHP 5.3)?

1
  • the maximum file size we can configure in post_max_size and upload_max_filesize variables in php 5.3 Commented Nov 3, 2011 at 5:54

2 Answers 2

3

According to the manual entry about post_max_size:

Note:

PHP allows shortcuts for bit values, including K (kilo), M (mega) and G (giga). PHP will do the conversions automatically if you use any of these. Be careful not to exceed the 32 bit signed integer limit (if you're using 32bit versions) as it will cause your script to fail.

Your limit could be 32bit signed integer limit. ~2,147,483,647 bytes on a 32 bit version. See the PHP_INT_MAX constant to get the value for your system:

PHP_INT_MAX (integer)

The largest integer supported in this build of PHP. Usually int(2147483647). Available since PHP 4.4.0 and PHP 5.0.5

Related:

Sign up to request clarification or add additional context in comments.

5 Comments

So that means though it is php 5.2 or 5.3 the maximum size is 2,147,483,647 bytes for 32 bit versions right?
yep. It basically takes an input of type integer. So depending on your php platform, the max value will differ. See this
Is there any way that I can install 64 bit php version on ubuntu 9.10 server?
If you're compiling it, then the process is the same. I'm sorry I should have been clearer. I meant, on a 64bit platform(your os and hardware) the interger max value will differ from the 32bit platform. If you're able to compile php from source, then your integer value should automatically be to the tune of 9e18 on a 64bit platform. Take care when installing from binaries, you'll need a 64bit version.
Yes My server is a ubuntu 9.10 64 bit one. Any recommendation giude for compiling php source on ubuntu 64 bit server? Thanks for your help
0

There is no real limit set by PHP to post_max_size or upload_max_filesize. However both values must be smaller than memory_limit (also you can modify this). Anyway, as values use something (a lot) smaller than your RAM. A hacker may attempt to send a very large file that will consume completely your system resources. To upload large file is better to use an FTP server.

1 Comment

Yes that is the main issue I talked with my client. But he wants this to be done. Thanks for your input

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.