How to increase my upload limit in php - php

I read so many articles out there in the internet and found that to change the php.ini file to upgrade the upload limit. But I do all the suffs and cant upload more than 10mb of files or so.
I am trying to add a feature to upload video file through the front end for users. But failed for some reason
Is there any other way to do it. Or is it because it is a video file or some thing like that

Make sure that you have (in php.ini, .htaccess, etc.):
increased post_max_size to at least twice the max file size that you might need to upload
increased upload_max_filesize to the max file size that you might want to upload
increased memory_limit to something bigger than post_max_size

On top of setting php.ini
upload_max_filesize = 200M
post_max_size = 200M
I owuld look into a flash uploader like uploadify. It will make your life much easier trust me.

Since you are changing the php.ini, are you restarting the webserver so that the changes take effect (if using mod_php)? Does the webserver itself have any restrictions set?

It's been a while since I've done this, but in my php.ini I have upload_max_filesize = 200M and I have post_max_size = 200M
I also set max_execution_time = 3000 If this is set too low, it'll cut off while the user is still uploading.
You should also bump up max_input_time and memory_limit

Related

How to change max upload size for files in Wordpress 4.4 at xampp

I wanted to upload a template to wordpress 4.4 which is running on xampp but it says that I only can upload 2MB. I've googled the problem and found an information that i need to change the parameter upload_max_filesize=32M in the file php.ini. I doesn't found the file in the Wordpress folder but in the xampp folder I found a file called php.ini with the parameter in it and I changed the parameter but nothing happened.
What can I do to increase the max template upload space?
Have you tried this already? http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/ It contains plenty of ways to increase the max upload size.
Make sure you increase post_max_size and upload_max_filesize, both limits.
So for example in PHP.ini:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Cause it may take longer to upload those files, you might want to increase max_execution_time as well.
post_max_size is the maximum size for all POST body data. upload_max_filesize is a maximum size only for files that are POSTed. Other types of POST body data are not subject to this limit. See Brad's answer over here: PHP post_max_size vs upload_max_filesize, what is the difference?

File not uploaded more then 300Mb in php

I try to upload 300Mb file but not uploaded and not show any error message. Variable size display if i check as phpinfo() is
post_max_size 750M
upload_max_filesize 750M
memory_limit 800M
max_execution_time 9001
if i try small file its working fine. like 3mb.
Please help me to find solution.
What I've always found is that post_max_size needs to be bigger than upload_max_filesize, and I usually aim for having post_max_size being three times the other setting, in this case post_max_size 2250M though that's not ideal.
I'd also suggest setting the memory_limit higher too, though max execution time should generally be fine.
Really though, using a chunking solution such as Plupload or jQuery File Upload is probably better in the long term.
My proble is solved. I need to set these variable on modsec2.user.conf file
SecRequestBodyLimit 1073741824
SecRequestBodyNoFilesLimit 1073741824
This is a apache server file. and error was shown on Apache error log.
Thanks to all for help.

Increasing Upload_Max_Filesize limit

I am facing a little problem with increasing the Upload_Max_Filesize limit on a clients server. The Upload_Max_Filesize is set to 2M and I need to increase it to at least 10M. There's no php.ini file currently present inside any of the folders albeit I tried creating a php.ini file and then uploaded it to the root folder of the website but that didn't work. I also edited the .htaccess file by putting these two lines inside it but, sadly, that didn't work either:
php_value upload_max_filesize 10M
php_value post_max_size 10M
I have access to the cPanel but it's mentioned inside the PHP Configuration page that:
These PHP configuration settings are customizable by the server administrator. They are listed for reference only.
Please let me know if there's any other way through which I can increase the limit of Upload_Max_Filesize.
You have to contact your host to increase your upload size. I've successfully done it from 5mb to 20mb. You just need to ask.

Large file size with forms?

I'm using codeigniter, but what I've done is made a small upload form. When I try to upload a 49kb file it works, when I try to upload a 14mb file, not only does it not work, but it seems to be refusing to see it as a post. $this->input->post() is returning false. That is before all the CI code that checks upload size etc. So I don't understand what can be keeping the file from being uploaded all the way.
PHP has file size restrictions, default usually at 10MB. If you have access to php.ini, edit upload_max_filesize and post_max_size.
You can typically also accomplish this by adding the following to your .htaccess file, if you're on Apache:
php_value upload_max_filesize 100M
php_value post_max_size 100M
Other flags that might affect your success are max_execution_time, max_input_time and memory_limit.

Changing the upload limit in php

I am developing a CMS where the clients will need to upload files larger than 2mb - up to 10mb at least. I have changed the details in the php.ini file and I cannot see anywhere else that the problem might be. Any help?
Cheers
Here's what I recommend changing (assuming Apache & PHP):
I've found this works well for up to about 30mb attachments
PHP Settings
max_execution_time = 120
max_input_time = 120
memory_limit = 30M
post_max_size = 30M
upload_max_filesize 30M
file_uploads = On (although it sounds like you already have this turned)
Apache Settings
LimitRequestBody 31457280
You need to set upload_max_filesize, post_max_size and memory_limit appropriately. post_max_size must be larger than upload_max_filesize, because there needs to be memory allocated for the request headers as well as the file payload.
In your php.ini:
; Maximum allowed size for uploaded files.
upload_max_filesize = 50M
; Maximum size of POST data that PHP will accept.
post_max_size = 50M
What errors are you getting in your error log once these have been done? Is it possible that your uploaded file is running foul of the memory limit on the script?
You can set the memory limit higher for this particular script by including the following line in your script:
ini_set("memory_limit","75M");
Make sure you changed upload_max_filesize AND post_max_size
As long as you have restarted your web service (ie apache) then the changes should take effect, however if you are developing for anyone other then yourself then instead of changing the php.ini I would add this to the upload script:
ini_set('upload_max_filesize', '10M');
as some people may not be able to modify php.ini this will change it just for the page it is on.

Categories