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.
Here are the results of the folder permissions when listing them:
I am starting Apache with the www-data
user.
Could you provide any advice or suggestions on how to fix this issue? I would greatly appreciate any help you can offer.