Im trying to upload from js to my php script a video that is 600Mb large, but post_max_size
in php.ini won't let me do that. I have no access to this file due to webhosting provider and I cannot change it in .htaccess. Is there any way of kind of evading this limitation and still upload a file, that is larger than the setting in php.ini?
Asked
Active
Viewed 258 times
0

Thomas
- 169
- 10
-
You should ask your hosting provider. If they say that is not possible, an alternative solution is to use virtual machine. – Sergio Rinaudo Dec 23 '21 at 18:02
-
Provider said that it is not possible to change this limit. – Thomas Dec 23 '21 at 18:03
-
Use [chunk upload](https://gist.github.com/ve3/9bc4ec3ee9bcce755c23bddbfce33306). Slice one big file into pieces and upload, once all files are upload completed then merge them. – vee Dec 23 '21 at 19:21
2 Answers
0
You can set upload_max_filesize in script ini_set("upload_max_filesize", "600M")
Use chunk uploading

Sonu Gupta
- 1
- 1
-
The problem is not in the `upload_max_filesize`, but in `post_max_size` and I thought you cannot change these settings. Aren't they used before even my php script starts so you cant change them? – Thomas Dec 23 '21 at 19:01
0
You can try it with .user.ini or .htaccess or ini_set(in your php script)
For me .user.ini works perfectly
Create a new file(0644 on Linux) .user.ini on your webspace/working dir with
max_execution_time = 10000 upload_max_filesize = 5000M post_max_size = 5000M
This is my config file .user.ini on my webspace and it works.
You can change the values to your needs.
Create a new file(0644 on Linux) .htaccess on your webspace/working dir with
php_value upload_max_filesize 1000M php_value post_max_size 1000M
Don't forget the first dot/point at the beginning of the file.
Put this on the beginning of your php script
ini_set('upload_max_filesize', '1000M'); ini_set('max_execution_time', '1000'); ini_set('memory_limit', '128M'); ini_set('post_max_size', '1000M');
If this won't work(and you can't modify php.ini) than contact your webhoster and ask him, what you can do.

Ruli
- 2,592
- 12
- 30
- 40

MotorCheck
- 1
- 6