PHP Increase Upload File Size Limit Using php.ini
Sometimes you need to upload large files. But the default file upload size settings restrict you to upload large files. PHP default setting allowed only 2MB file upload size.
So if you want to upload large file, then you need to set the following configuration into your your php.ini file:
memory_limit - This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server.
upload_max_filesize – The maximum size of an uploaded file.
post_max_size – This sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.
There are two methods two fix this problem.
Edit php.ini
php.ini file usually stored in /etc/php.ini or /etc/php.d/cgi/php.ini or /usr/local/etc/php.ini on linux server. On WAMP SERVER, PHP.INI file is stored in wamp/bin/php/php.ini.
- memory_limit = 32M
- upload_max_filesize = 10M
- post_max_size = 20M
OR you can also Edit .htaccess file residing on your root directory. This is useful when you do not have access to php.ini file.
- php_value upload_max_filesize 10M
- php_value post_max_size 20M
- php_value memory_limit 32M
Follow @phpzag

Thanks for the sensible critique. Me and my neighbor were just preparing to do a little research about this. We got a grab a book from our local library but I think I learned more from this post. I am very glad to see such great information being shared freely out there.
Great goods from you, man. You make it enjoyable and you still care for to keep it wise.
I can’t wait to read far more from you. This is really a tremendous site.