Increase these memory and timeout limit values to worst case, in seconds.
Upload Limits
For uploading large files there are some Apache and PHP limits and timeout values set that you might need to update -
PHP
Edit file C:\WampDeveloper\Config\Php\php.ini
Find and change settings:
upload_max_filesize = 256M
post_max_size = 257M
This will increase upload limits to 256 MB.
Note that “post_max_size” is set 1 MB larger than “upload_max_filesize” to take into account for any additional meta-data sent.
http://www.php.net/manual/en/ini.core.php#ini.post-max-size
Notes -
1. file_uploads
file_uploads = On
“file_uploads” has to be on. And usually is by default for most WAMP and LAMP setups.
2. memory_limit
memory_limit = 258M
While the PHP docs state that “memory_limit” is generally set to be higher than the “post_max_size” value, is not absolutely required to be so, because file uploads are not stored/output in their entirety to memory, instead they are buffered part-by-part and written out to the temporary directory (C:\WampDeveloper\Temp\) as the upload progresses.
3. upload_tmp_dir
upload_tmp_dir = "C:/WampDeveloper/Temp"
This is the directory where file uploads are temporarily placed. It has to exist, and has to not have special/restrictive permissions set on it. Also there must be enough free disk space on this partition, and no space quota restriction set on this directory.
If using your own coded scripts to do file uploads, note that the file will be deleted from the temporary directory at the end of the request if it has not been moved away or renamed.
4. max_imput_time and max_execution_time
max_input_time = 300
“max_input_time” is the amount of time a PHP script can spend receiving input (the time spent receiving the uploading file). The default is 60 seconds. This time (input time) does not go towards the “max_execution_time” limit (…you don’t need to modify “max_execution_time” for file uploads).
5. max_file_uploads
max_file_uploads = 20
“max_file_uploads” sets the maximum number of files (default is 20) that can be uploaded by a single POST request (form submit). If you are uploading more than 1 file at a time, you have to set “post_max_size” to a greater value than “upload_max_filesize” times “max_file_uploads”.
http://php.net/manual/en/features.file-upload.post-method.php
http://php.net/manual/en/features.file-upload.common-pitfalls.php
PHP-FCGI
When using PHP-FCGI (a separate PHP process ran via Apache’s mod_fcgid), mod_fcgid caps uploads to 128KB by default in newer versions (v2.3.6 and above), and usually returns a “500 Server Error” when that limit is reached.
Edit file C:\WampDeveloper\Config\Apache\extra\wampd-php5-fcgi.conf
Inside the <IfModule fcgid_module> block, add in or edit setting:
FcgidMaxRequestLen 268435456
This will set the max upload value to 256 MB. Or for a 1GB (1024MB) upload limit, use value: 1073741824.
You should probably set this to match whatever max upload value you have in php.ini – though it does not have to be so.
Execution Timeout Limits
For processing requests there are some Apache and PHP timeout values set that you might need to update -
The default is usually 300 seconds (5 minutes)…
Apache Wait Time for Input/Output
Edit file C:\WampDeveloper\Config\Apache\extra\httpd-default.conf
Timeout = 300
http://httpd.apache.org/docs/2.2/mod/core.html#timeout
PHP Script Processing/Runtime Limits
Edit file C:\WampDeveloper\Config\Php\php.ini
max_execution_time = 300
http://php.net/manual/en/info.configuration.php#ini.max-execution-time
PHP FastCGI Processing Timeout
When running PHP-FCGI, the FastCGI configuration sets a value on the time a FastCGI application has to respond to the I/O request (default is 40 seconds)…
Edit file C:\WampDeveloper\Config\Apache\extra\wampd-php5-fcgi.conf
FcgidIOTimeout 120
PHP Memory Limit
PHP has a limit set on the amount of memory a PHP script is allowed to allocate.
memory_limit = 258M
Generally you don’t want to set a value above 2000MB (slightly lower than 2GB / 2048MB) as it 1) begins to exhaust the memory space PHP can use running as a 32 bit process and 2) has been known to trigger PHP bugs. Though normally it shouldn’t need to be higher than 1024MB as anything above is usually indicative of bad memory management or memory leakage by the PHP script used.
.htaccess and PHP code that overrides php.ini settings
If you are experiencing a Apache or PHP error message:
Out of memory (allocated X) (tried to allocate Y bytes)
I would use Notepad++ (which has a nice find-in-files search feature) or your choice of an Editor to search your website’s DocumentRoot (\webroot) folder -
C:\WampDeveloper\Websites\domain.name\webroot\
…all files; for occurrences of this text/string:
memory_limit
To see if it’s being set in any .htaccess files (via directives: “php_value” or “php_admin_value”) or PHP files (via function: “ini_set()”). Then manually comment out those lines.
A) An .htaccess file could override php.ini’s memory_limit:
php_value memory_limit 20MB
or
php_admin_value memory_limit 20MB
B) A PHP script could override php.ini’s memory_limit:
ini_set("memory_limit","20M");