How to increase maximum upload file size in Prestashop

If you're trying to upload a theme/module that has a big package's file size from your Admin Panel on your Prestashop website, you might get an error:

The file is too large. Allowed maximum size is 2 MB.

I don't think this is the first time you've seen this mistake, and it won't be your last. Follow this PrestaShop tutorial for discovering 2 easy solutions to fix the upload_max_filesize error on uploading a commercial module using Module Manager from the modules page in Prestashop Admin Panel instead of asking your hosting provider.

How to increase Maximum Upload File Size in Prestashop

Let's talk we have a new Prestashop module called DocumenThemix. This is one of our latest Prestashop modules helps you create professional, personalised Prestashop documents such as Invoices, Credit Slips or Delivery Slips in PDF that fit your brand, in seconds. It's a great module, and its file size is 7MB.

Sometime, the php configuration puts limits on upload file size. The default settings will restrict this to a max 2 MB upload file size. You need to increase this value to upload your favourite modules & themes (do you know how to install Prestashop Themes?).

Allowed maximum size is 2 MB

First, we need to know about upload_max_filesize and 2 other values.

  • Upload_max_filesize - The maximum length of an uploaded record.
  • Memory_limit - This unit is the maximum quantity of memory in bytes that a script is permitted to allocate. This helps prevent poorly written scripts for eating up all to be had memory on a server. Note that to have no memory restriction, set this directive to -1.
  • Post_max_size - Sets max size of post records allowed. In case you want to upload large files such as the premium Prestashop themes or Documenthemix module, this value should be large than upload_max_filesize. If reminiscence restriction is enabled by your configure script, memory_limit additionally affects document uploading.

Generally speaking, memory_limit need to be large than post_max_size.

I suggest two methods for fixing this problem.

Edit the php.ini

Open php.ini file at /etc/php/apache2/php.ini or your-root-website/php.ini, search for the following variables and change these to:

memory_limit = 50M

upload_max_filesize = 10M
post_max_size = 10M

Some extra values to edit if you want a higher overall performance of your website on the server:

max_execution_time = 300

max_input_time = 600
memory_limit = 720M

Save the file and restart the Apache web server!

Edit .htaccess

If the first way does not work, or you don't have get right of entry to to the servers file system. For example: your web page is hosted on a commercial web server, then edit the .htaccess file in your website's root.

Add these source codes into your .htaccess

php_value upload_max_filesize 10M

php_value post_max_size 20M
php_value memory_limit 32M

Save your file and enjoy your time.

Get this Advanced Cart Rules module

New module.

Xleft module

Xleft shows customers how much more they need to spend to get free shipping in real time.

Latest modules update!

ChargeMe v5.4.1 ⊙
Clear the cart & redirect to the checkout page.


Age Restriction - 18+ v2.3.4⊙
Fix the Smarty issues.


Newsletter Popup v3.2.4 ⊙
Fixed the duplicate coupon codes issue.


Trusty v1.4.7 ⊙
Compatible with both PrestaShop 1.7 & PrestaShop 8.

PrestaSOO team
Everything you need to make a living doing work you love.

Discover

It is a wise investment

PrestaShop modules we created first to solve the problem of our own business - an e-Commerce site. That means they are very useful for serious business. If you value your web property, these modules are a wise investment.
Sarah Reeves, App Developer @ PrestaSOO
Made with in Paris & Hanoi
PrestaSOO © 2024. All rights reserved. // Privacy Policy Terms of Service