How can I prevent large Apache/PHP file uploads from failing?
apache, file-upload, large-files, memory-management, php
Solution
You can test the params in a script, too. Perhaps this helps:
- max_execution_time = ini_set("max_execution_time", "-1");
- post_max_size = ini_set("post_max_size", "200M");
- memory_limit = ini_set("memory_limit", "200M");
- upload_max_filesize = ini_set("upload_max_filesize", "200M");
In .htaccess:
php_value upload_max_filesize 200M
php_value memory_limit 256M
php_value max_execution_time 18000
Here are nice articles about this topic: http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/ | https://www.dokuwiki.org/faq:uploadsize
Is Suhosin installed on your server or do you use fcgi ;-)?
Problem
I recently installed a PHP download portal on one of our servers. Everything is working fine, but users can't upload large files (~ 20 MB). I set the following settings to extremely large values or unlimited: ``` memory_limit upload_max_filesize post_max_size memory_limit ``` Full `php.ini` here: http://pastebin.com/NrqJvMVM But it still fails after restarting the server. Am I missing a setting? Do I have to update any values in the Apache configuration? Could a company firewall somehow interfere with that? EDIT: I checked phpinfo() and the master configuration still shows the old values. The config file C:\Windows\php.ini however, has the new values. Am I using the wrong config file.