3

I cannot upload product images on Magento 2 in Xampp. When I try to upload the product image, it gives me an error. Please see the following image:

enter image description here

I have also tried it again but the same error appeared.

Please help me to resolve this issue.

Looking forward to your reply.

Siva
  • 1,120
  • 1
  • 14
  • 33

2 Answers2

1

I agree with other answer here that it is file permission issue. M2 on windows in xampp isn't great for this reason. I recommend docker. That said there is a post here regarding xampp permissions that might help.

https://stackoverflow.com/questions/9349469/changing-php-write-permissions-in-xampp-on-windows-7

Dominic Pixie
  • 7,520
  • 4
  • 17
  • 56
0

Except permission issues this error also can show up when you use different version of PHP. Probably you cannot run Magento 2.2.6 with PHP 7.2 without patches (if they exist)

Please check on first place what version of PHP you have on Your Xampp server.

This may be helpful: https://community.magento.com/t5/Installing-Magento-2-x/What-is-the-optimal-version-of-PHP-to-Run-2-2-6/td-p/111598

UPDATE: I didn't notice that You have also issue with logo, its looks like this bug(Magento 2.3), check maybe with logo first, if its working try change this also for products: https://github.com/magento/magento2/commit/ba69bfec127bed8c39c7d9e7b73d10b54449b158

BartZalas
  • 1,757
  • 12
  • 23
  • Thanks for your suggestion. For your information, I have checked the same on Magento 2.3.0 in Xampp. There also I can't upload the images. Checked the devdocs and see Magento 2.3.0 supports PHP version 7.2. What should I do now? – Siva May 21 '19 at 05:55
  • Users ownership on directories, is it correct? – BartZalas May 21 '19 at 07:55
  • What do you mean by ownership on directories? For your info, I have already set the permission 777 to the pub/media folder – Siva May 21 '19 at 11:49
  • So permissions should be allright. What about this https://magento.stackexchange.com/questions/258965/magento-2-3-cant-upload-product-images?rq=1 It looks like you have also problem with logo, I didnt notice. I update my answer. – BartZalas May 21 '19 at 21:39
  • I have tried the link which you provided but it's not working as expected. – Siva May 22 '19 at 06:55
  • What size of image? Did You try with different image and type? – BartZalas May 22 '19 at 15:09
  • I have tried large to small size images with the types jpg, png but still can't upload the images. So it's not related to the size of images. – Siva May 23 '19 at 06:03