I am trying to upload larger files so I set this in PHP code:
ini_set('upload_max_filesize', '1000M');
ini_set('post_max_size', '1100M');
ini_set('memory_limit', '1200M');
but $_POST
and $_FILES
are empty. But when I change php.ini
settings it works. Why it doesn't change setting on the fly?
It's too late to have those settings changed after PHP has started.
upload_max_filesize
- uploads happen before the PHP script runs and your ini_set() is executedpost_max_size
- likewiseAnd even if you could change memory_limit
(depends on server configuration), it would be too late again if you expect that big of an upload.
See ini_set()
and http://www.php.net/manual/en/ini.list.php for more info.