FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.
Knowledgebase: PHP/MySQL
Is there a limit to the file size allowed for uploads by PHP scripts?
Posted on 01 January 2004 07:08 AM
In order to prevent too many server resources from being used by a file upload process, PHP scripts are subject to restrictions. The limitations are ruled by various factors, including upload file size limits, memory constraints, and CPU runtime. The restrictions for PHP when run as an Apache module are as follows:

Limits for the Community Servers (See Note)
CPU runtime: 60 seconds
Memory: 128 MB
post_max_size: 64 MB
upload_max_filesize: 64 MB

Limits for the High Capacity Servers (See Note)
CPU runtime: 60 seconds
Memory: 128 MB
post_max_size: 64 MB
upload_max_size: 64 MB

Default Limits for the Managed QuestServers (MQS)
CPU runtime: 60 seconds
Memory: 128 MB
post_max_size: 64 MB
upload_max_size: 64 MB
The Managed QuestServers are dedicated servers and the above limits are able to be adjusted by the client if needed via php_value in an .htaccess file.

Note: When viewing phpinfo(),the Local Value reflects the server's actual configuration/settings and overrides the Master Value. The Master Value reflects a stock (default) PHP configuration.

CGI is ruled in a similar way as PHP, but slightly more relaxed as PHP is buffering the input and can increase the overall footprint size of the Apache engine. With CGI, it can balloon up in size, but once the script finishes running, its instance ends and the resources are reclaimed by Linux. This is why PHP must be kept on a shorter leash as it is a persistent engine that has a much longer lifespan.

For CGI limits, click here.

Note: Server limits are for Genesis Class Servers,  Legacy Enigma and Phoenix Class Servers have lower limits. Free Genesis Class Upgrade is available for Legacy Class Hosted packages.

Difference between CPU time and wall time explained.