Sometime, you require files larger than 2 MB to upload on your PHP websites, which it does not let you do by default. Showing it is over the limit. In PHP, default upload size is 2MB, which is already set in “php.ini” file.
But What if you need to upload file larger than 2 MB? if you are using WordPress, at some point you have faced this problem.
To increase the maximum upload size in php, you need to change “upload_max_filesize” value which is set to 2MB by default.
if you are using xampp server in UBUNTU than php.ini file will be found at
if You are using Xampp Serve in window than php.ini file will be located in
then find “upload_max_filesize” in php.ini and increase its size. default size for uploading file is 2 MB as I mentioned earlier.
set Upload_max_filesize=8M or whatever MB size u like.
if you are uploading file greater than 8MB then You Need to change “post_max_size” in php.ini, hence that settings allows php to handle post request to specified Mb size.
set post_max_size=20M or whatever MB size you like.
However, it’s not done still. you also need to consider the time that file upload takes. default execution time is 30s. If your file is large, than it requires some more time to be uploaded. you can set it by changing “max_input_time” and “max_execution_time” to something 300 (which is 5 mins).
If you make that change, than it will apply to all applications inside htdocs. Now, what if you want it for particular app, than you need to put .htaccess file in it or have to modified it if already exist.
changes to .htaccess file for cpanel user to upload larger file.
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value max_input_time 300
php_value max_execution_time 300
or you can also set this setting in your index.php file as follow.
ini_set('upload_max_filesize', '10M'); ini_set('post_max_size', '10M'); ini_set('max_input_time', 300); ini_set('max_execution_time', 300);
You can increase or decrease file upload size using this settings in php. If you liked this blog or want to know anything related to this setting than feel free to ask in comment section below.
Oppo has finally changed their smartphone look with the new arrival of Oppo F5. Oppo is widely known for their selfie-centric phones. They did not…..
Did you ever thought that what does the Pause/Break button do? Is it to use when you are stuck at work and waiting for a…..
Google recently announced their new Google Pixel Smartphones. With a more modern design, a larger screen, and battery and an exclusive paint job. What could…..
When you consider about turning something off, it is just as simple as pressing switch. You can just flick the switch, rotate the key for…..
For some people, Auto update in Windows OS is very annoying. Especially, when you got a limited data connection. So, you have to turn Auto update…..
Sometime, you require files larger than 2 MB to upload on your PHP websites, which it does not let you do by default. Showing it…..
Recently, number of cases of getting Credit card or bank account hacked has grown too much. So, probably this is a great time to talk…..
Kids from 2000s, you may not remember a time before a 120 GB hard drives were the bare minimum, but other of you from 90s…..
You probably know someone, who is always miss placing stuff, I do personally. Whether they can not find their keys in the morning, they leave…..
From the title of the blog, you will think that, what is new in that? But well, there are some features in this you will…..
Are you looking for new Status to put on your Social media account? Whether you are feeling sad or true love, you will get all…..
The Chinese smartphone manufacturer Vivo always try to give you good and better Camera. Which is boring in a way. You just don’t get any…..
If you have followed Apple at all, you have probably heard the old cliche that it does things better, instead of doing them first. Nowhere…..
When you finally decide to address a huge bottleneck in your computer by upgrading to an SSD for your Boot drive. But when you finally…..
Using the word Bacteria to refer to a single germ, which should be bacterium instead, mixing up Discrete and discreet and saying my Facebook got…..
Warning! Deleting this file can cause damage to Windows or another Program. Odds are pretty high that you have seen a message like that, if…..
Last year’s Galaxy Note 7 was perhaps “the most famous Samsung smartphone in history”, for all the wrong reasons. The company kicked off its recovery…..
2017 has been an incredibly exciting year, when it comes to smartphone launches. But that doesn’t mean, it will not get even better. So, Let’s…..
Most of us uses smartphone with 3G or 4G mobile networks, well mostly 4G after Jio Storm. But do you ever think what does it…..
Chinese Mobile manufacturer Lenovo made a great success with their Lenovo K series. Especially with Lenovo K3 Note, Lenovo K6 Power and Lenovo K6 Note……
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.