"1G" is not a valid maximum size in PrestaShop

 When I try to load one from your modules it gives me an error that says: "1G" is not a valid maximum size

It looks like you can't upload ANY .zip file to shop's back office no matter if it is a module, theme, or anything else.
The problem you have is related to configuration of php.ini in your hosting environment that points that maximum upload size is "1G" while symfony (prestashop is based on symfony engine) accepts values in "K" and "M" (but not in "G"). The problem you have is well known and described here: https://github.com/PrestaShop/PrestaShop/issues/14568 and https://github.com/PrestaShop/PrestaShop/pull/10892 
There are two possible solutions:
  1. alter php ini and add there clause like upload_max_filesize = 100M
    this method will solve all upload problems in your shop's back office, not only upload of modules but any file
  2. modify prestashop file: /vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/File.php
    change code:
    $factors = array(
    'k' => 1000,
    'ki' => 1 << 10,
    'm' => 1000000,
    'mi' => 1 << 20,

    $factors = array(
    'k' => 1000,
    'ki' => 1 << 10,
    'm' => 1000000,
    'mi' => 1 << 20,
    'g' => 1000000000,
    'gi' => 1 << 30,
if you do not want to fix this problem but install module only, the other possible solution to upload and install modules is manual installation with usage of FTP, described here:

Module installation

Follow these steps:
  1.  Unzip (decompress) the module archive file
  2.  Using your FTP software
  3.  Place the folder in your PrestaShop /modules folder
  4.  Connect to the BackOffice of your shop
  5.  Go to Back Office >> Modules.
  6.  Locate the new module in the list, scrolling down if necessary.
  7.  In the row for the new module, click Install.
  8.  Locate the module again. If necessary, click >> Configure.
  9.  Once configuration is complete, be sure to test the module immediately to confirm that it functions as planned.
best regards
Share on Google Plus


This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment


Post a Comment