0

I'm new to Magento 2 and have successfully deployed magento 2.4.1 with apache on Kubernetes. However, I'm facing issues with product images not being displayed when I mount pub/media using cosfs. The following errors are encountered:

[2023-05-22 08:48:53] main.CRITICAL: Directory "/var/www/html/pub/media" cannot be created Warning!mkdir(): File exists {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Directory \"/var/www/html/pub/media\" cannot be created Warning!mkdir(): File exists at /var/www/html/vendor/magento/framework/Filesystem/Driver/File.php:236)"} []

The main reason for this issue is that the mount user is set as root, and I am unable to change it because I used Tencent's web interface for mounting.

enter image description here

Here are the results of the folder permissions when listing them:

enter image description here

I am starting Apache with the www-data user.

enter image description here

Could you provide any advice or suggestions on how to fix this issue? I would greatly appreciate any help you can offer.

Zeck
  • 6,433
  • 21
  • 71
  • 111

0 Answers0