Possible Duplicate:
overriding upload_max_filesize
i use these code for change upload file size :-
echo ini_get('upload_max_filesize').'<br/>'; ini_set("upload_max_filesize","300M"); echo ini_get("upload_max_filesize");
BUT I GOT
2M 2M
which is set in php.ini.
i want to change file upload size limit.
The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size. Depending on your host, changing these two PHP variables can be done in a number of places with the most likely being php. ini or . htaccess (depending on your hosting situation).
To increaes file upload size in PHP, you need to modify the upload_max_filesize and post_max_size variable's in your php. ini file. In addition, you can also set the maximum number of files allowed to be uploaded simultaneously, in a single request, using the max_file_uploads .
The best way to modify the maximum file upload size is to set the values in the php.ini file. There are two directives in the php.ini file that you will need to change which are: upload_max_filesize: This is the maximum size of an individual uploaded file. The default value for this is 2MB.
Another way to get rid of the uploaded file exceeds the upload_max_filesize directive in php.ini error is by tweaking the wp-config.php file located in your root directory. All you need to do is log in to the hPanel and access public_html to edit the wp_config. php file.
You can't set upload_max_filesize using ini_set () because upload_max_filesize is a PHP_INI_PERDIR type that means changeable only via: php.ini, .htaccess or httpd.conf as stated at: php.net/manual/en/configuration.changes.modes.php Actually, you can use shorthand notation outside of PHP.ini; you can use it in .htaccess and also with ini_set.
The uploaded file exceeds the upload_max_filesize directive in php.ini is an error that occurs on your WordPress site when you upload a file that exceeds the limitations set by your webserver. As scary as this error may seem, the solutions are pretty straight-forward.
upload_max_filesize "2M" PHP_INI_PERDIR
PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or .user.ini (since PHP 5.3)
So you can't use ini_set
for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With