SUPEE-7405 的新版本已发布,可解决此问题:
http://magento.com/security/patches/supee-7405 http://magento.com/security/patches/supee-7405
更新于 2016 年 2 月 23 日
此版本的更新版本现已推出。这些更新添加了对 PHP 5.3 的支持,并解决了原始版本中遇到的上传文件权限、合并购物车和 SOAP API 等问题。
请注意,即使没有修订的补丁,您也可以使用建议的文件权限来修复问题(见下文)。
Magento 期望网络服务器拥有站点文件:
http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after
您可以通过使网络服务器成为文件的所有者来解决此问题。
chown -R web-server-user-name magento/root/path
网络服务器用户名通常是www-data
or apache
.
如果您按照上述链接中的说明进行操作,网络服务器将具有对所有文件的读取权限,以及对媒体文件和 var 文件的写入权限。这应该是典型站点操作所需的全部内容。如果您需要使用 Magento Connect,您必须暂时授予网络服务器对所有文件的写入权限。
所有文件权限都设置为 CHMOD 640,这使得所有用户都无法访问它们。
只有网络服务器用户需要访问这些文件。无需向所有用户授予任何权限。
例如,如果您需要通过 FTP 编辑或上传文件,您可能希望向特定用户授予访问权限。在这种情况下,我要做的就是设置一个拥有该文件系统的用户并将文件组设置为网络服务器:
cd magento/root/directory
# Set ownership
# 'username' should be the file system owner username
# 'webserver' should be the webserver username
chown -R username:webserver .
# Give the user read/write access to all files.
# Give the webserver read access to all files
find . -type f -exec chmod 640 {} \;
find . -type d -exec chmod 2750 {} \;
# Give the user and the webserver read/write access to var and media
find var/ -type f -exec chmod 660 {} \;
find media/ -type f -exec chmod 660 {} \;
find var/ -type d -exec chmod 2770 {} \;
find media/ -type d -exec chmod 2770 {} \;
chmod 2770 includes
chmod 660 includes/config.php
上述命令将授予您的文件系统所有者对所有内容的读/写访问权限,以及网络服务器对所有内容的读访问权限。网络服务器还能够写入 media 和 var 目录。