Cannot override max upload file size

Hello,
I am unable to upload and override the php.in settings of 2M

I used all this

ini_set(“upload_max_filesize”, “9M”);
ini_set(“post_max_size”, “9M”);
ini_set(“max_execution_time”, “100”);
ini_set(“max_input_time”, “100”);

set_time_limit(100);

No Video Is getting uploaded above 2M

The php.ini settings are 2 M

I also used this
<input type=“hidden” name=“MAX_FILE_SIZE” value=“9000000000” />

a file 1.8 mega gets uploaded

a file of 5 and 7 mega does not

Many Thanks

I am still on the localhost, I even now added a .htacess file
php_value upload_max_filesize 12M
php_value max_execution_time 300

Then How should I solve the issue
does uploading a php.ini solve the issue
In the root and also may be on the folder where the upload takes place

Depends on the server’s configuration.
Apache has to be configured to allow .htaccess use.

If it isn’t, it will cause a HTTP 500 error.

What if I use these settings on .htacess, and the things get ruined, I tried .htacess locally, i received a fatal exit,
There is an .htacess on the online provider, will setting such values not cause the server to give the same result

You can’t set those configuration values using ini_set. Why? Because the script is called after the upload process, at which point the file has already been discarded by PHP as it’s too large for the value set in php.ini/ .htaccess.

Setting the values in .htaccess does work because that’s parsed before PHP is started. :slight_smile:

maybe there is a limit imposed by your web host provider.