The error message appears every time I upload image on a product.
The complete message is:
Unable to write file into directory \D:/XAMPP/htdocs/magento/pub/media/catalog/product\cache\914b1ba9268f8c1d0e58a8e7ce614488/s/o. Access forbidden.
The version of Magento I installed is 2.1.6, on XAMPP for Windows. The version of PHP installed in XAMPP is PHP 5.6.20.
vendor/magento/module-catalog/Model/View/Asset/Image.phpas stated in this answer, that is, replacing all occurrences of
- ...and this answer, that instructs to remove
DIRECTORY_SEPARATORin line 226
chmod -R 777 ./on
/XAMPP/htdocs/magento/pub/media/catalog/productwith Bash, in case it has something to do with the permission
And nothing above has worked for me, except that the first option I tried give me a new error when I upload image on a product:
The file "D:/XAMPP/htdocs/magento/pub/media/tmp/catalog/product/s/o/test_image.png" doesn't exist or not a file
But when I check the file, it exists there!:
Is there anything I can do to solve this problem? Any help would be appreciated. Thanks!