Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upload module via backend #14568

Closed
kernig opened this issue Jul 10, 2019 · 11 comments
Closed

Can't upload module via backend #14568

kernig opened this issue Jul 10, 2019 · 11 comments
Labels
1.7.5.2 Affects versions BO Category: Back Office Modules Component: Which BO section is concerned No change required Resolution: issue closed because expected as is

Comments

@kernig
Copy link

kernig commented Jul 10, 2019

Describe the bug
When you try to install a module it shows an error: "1G" is not a valid maximum size.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Module Manager'
  2. Click on 'Upload Module'
  3. Select your module to start upload
  4. See error

Additionnal information
PrestaShop version: 1.7.5.2
PHP version: 7.2

This is caused by the PHP setting upload_max_filesize, which is set to 1G

I found a fix on this website:
https://kijam.com/tienda/reparar-error-1g-is-not-a-valid-maximun-size-en-prestashop-1-7/

Quote:
You need to edit this file "/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/File.php"

Replace this part:
$factors = array(
'k' => 1000,
'ki' => 1 << 10,
'm' => 1000000,
'mi' => 1 << 20,
);

with this
$factors = array(
'k' => 1000,
'ki' => 1 << 10,
'm' => 1000000,
'mi' => 1 << 20,
'g' => 1000000000,
'gi' => 1 << 30,
);

@khouloudbelguith
Copy link
Contributor

Hi @kernig,

Could you please follow this link: https://github.com/PrestaShop/php-ps-info
phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement.

  1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file.
  2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phppsinfo.php, replacing example.com with your own domain name.
  3. Now you can view all of the information about PHP for your server for that particular directory.

image
Thanks to check and feedback.

@khouloudbelguith khouloudbelguith added 1.7.5.2 Affects versions BO Category: Back Office Modules Component: Which BO section is concerned NMI Status: issue needs more information labels Jul 10, 2019
@kernig
Copy link
Author

kernig commented Jul 10, 2019

Hi @khouloudbelguith,

thank you for your quick response.
You are right, the script marks the G values red.
In the PHP documentation it says "PHP allows shortcuts for byte values, including K (kilo), M (mega) and G (giga)." so in my opinion presta should be able to handle that :-)

@khouloudbelguith
Copy link
Contributor

@kernig, could you please provide me a screenshot about your PHP's information for your server that you have just uploaded.

Thanks!

@kernig
Copy link
Author

kernig commented Jul 10, 2019

prestaresult
@khouloudbelguith
if you need more details, just let me know.

@khouloudbelguith
Copy link
Contributor

@kernig, Thanks for your feedback.
Ye, I tried with 1G with my server & it not accepted.
image
Ping @PrestaShop/prestashop-core-developers what do you think about his suggestion?

In the PHP documentation it says "PHP allows shortcuts for byte values, including K (kilo), M (mega) and G (Giga)." so in my opinion presta should be able to handle that

Thanks!

@khouloudbelguith khouloudbelguith added Waiting for dev Status: action required, waiting for tech feedback and removed NMI Status: issue needs more information labels Jul 10, 2019
@PierreRambaud
Copy link
Contributor

It's normal because 1G is not a supported value by Symfony.
An issue has already been created #10892

@khouloudbelguith
Copy link
Contributor

@PierreRambaud, thanks for your feedback.
@kernig, you should not use G with upload_max_filesize.
I close the issue, Feel free to open a new one when needed.

Thanks!

@khouloudbelguith khouloudbelguith added No change required Resolution: issue closed because expected as is and removed Waiting for dev Status: action required, waiting for tech feedback labels Jul 10, 2019
@kernig
Copy link
Author

kernig commented Jul 10, 2019

@khouloudbelguith, thanks for verifying it.
@PierreRambaud, thank you. Didn't see it, when opening this issue.
I already posted it in the symfony repository and they asked me to send a pull request.
I'm not sure if it would be better to wait for the next symfony update in prestashop or if there should be a seperate fix for the meantime. If they implement it in 3.4 does presta get it with the next update automatically?

@kernig
Copy link
Author

kernig commented Jul 19, 2019

Hey @khouloudbelguith, @PierreRambaud,
symfony team accepted the pull request. When does the symfony 3.4 update find it's way to the presta core?

@Progi1984
Copy link
Contributor

@kernig Hi, have you got the link to the PR ? Thanks :)

@kernig
Copy link
Author

kernig commented Jul 19, 2019

Hi @Progi1984, sure, it's symfony/symfony#32485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.5.2 Affects versions BO Category: Back Office Modules Component: Which BO section is concerned No change required Resolution: issue closed because expected as is
Projects
None yet
Development

No branches or pull requests

4 participants