How to Increase the Maximum Upload Limit in PHP for OpenCart

There are two things that dictate the file size that can be uploaded in PHP based websites. They are two PHP config variables:

  1. post_max_size

  2. upload_max_filesize

post_max_size

This variable determines the total size of the post data, which includes files as part of that data.

Example: post_max_size = 10M means that you cannot upload more data than 10MB.

upload_max_filesize

The second variable determines the maximum size of every single file in the post. However, the total cannot be larger than the post_max_size.

Example: if your post_max_size = 10M and the upload_max_filesize = 2M, you can upload 5 files with a size of 2MB, but you cannot upload a file that is 3MB.

If the upload_max_filesize is greater than the post_max_size, you can only upload a file that is smaller or equal than the post_max_size.

These two variables are usually controlled from 3 common places for shared hostings:

  1. cPanel

  1. .htaccess

  1. php.ini

Quick summary

This is valid for all PHP based websites, not just OpenCart. You can get more information on the subject by clicking here and here. We hope this helps, leave us a comment if you need help with anything!

Join 11,000+ subscribers receiving actionable E-commerce advice

* Unsubscribe any time

Trending blogs

comments powered by Disqus