CentOS 7 Lampp 上 Magneto 2.4 的正确权限是什么

问题描述 投票:0回答:1

我在 XAMPP 上使用 Linode 和 CentOS 7 Magneto 2.4。我尝试了各种权限集,但最终遇到了这个问题。请提出正确的许可。

Fatal error: Uncaught Zend_Cache_Exception: cache_dir "/opt/lampp/htdocs/magento/var/page_cache" is not writable in /opt/lampp/htdocs/magento/vendor/magento/zendframework1/library/Zend/Cache.php:209 Stack trace: #0 /opt/lampp/htdocs/magento/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/opt...') #1 /opt/lampp/htdocs/magento/vendor/colinmollenhour/cache-backend-file/File.php(87): Zend_Cache_Backend_File->setCacheDir('/opt/lampp/htdo...') #2 /opt/lampp/htdocs/magento/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array) #3 /opt/lampp/htdocs/magento/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true) #4 /opt/lampp/htdocs/magento/vendor/magento/framework/App/Cache/Frontend/Factory.php(158): Zend_Cache::factory('Magento\\Framewo...', 'Cm_Cache_Backen in /opt/lampp/htdocs/magento/vendor/magento/zendframework1/library/Zend/Cache.php on line 209
php magento centos7 linode
1个回答
0
投票

在 XAMPP 上使用 CentOS 7 Magneto 2.4 时的正确权限。 将授予所有 magento dirrecty apache 用户和组。

这可以通过跑步来实现

sudo chown -R apache:apache /opt/lampp/htdocs/magento/

如果您想运行命令,例如清除缓存或重新索引,请记住将您的用户添加到 apache 组中。

可以通过运行以下命令轻松完成

sudo usermod -a -G apache $USER

需要重新启动实例才能应用权限

最后通过运行来应用权限

find app/code var/view_preprocessed vendor pub/static app/etc generated/code generated/metadata \( -type f -or -type d \) -exec chmod u-w {} + && chmod o-rwx app/etc/env.php

您可以在 Adobe 网站

上阅读更多信息
© www.soinside.com 2019 - 2024. All rights reserved.