overriding upload_max_filesize

Those settings are not going to have any effect when set via ini_set.

The reason is that PHP needs those values before your script is even executed. When an upload occurs, the target script is executed when the upload is complete, so PHP needs to know the maximum sizes beforehand.

Set them in php.ini, your virtual host config, or in a .htaccess file. A typical .htaccess file would look like this:

php_value post_max_size 30M
php_value upload_max_filesize 30M

Leave a Comment