如何修复 centos 7 apache 上 prestashop 的权限错误?
How to fix permissions error with prestashop on centos 7 apache?
正在安装 Prestashop 1.7.6.2
发生错误:
You need to grant write permissions for PHP on the following directory: /var/www/html/presta
安装 Prestashop 时出现此错误。它停留在 0%。
我有:
- centos 7
- PHP 7.3.14
如果您使用的是 apache,则将 var/www/html/presta 所有者更改为 www-data,如果您使用的是 nginx,则更改为 nginx。
chown -R www-data:www-data /var/www/html/presta
但不要将权限更改为 777,因为这会完全打开您的站点,而是将目录更改为 0755,将文件更改为 0644。
内部商店根文件夹:
find . -type f -exec chmod 644 -- {} +
为所有文件设置适当的权限
find . -type d -exec chmod 755 -- {} +
为所有目录设置适当的权限
chmod 666 .htaccess
为 .htaccess 设置适当的权限
我用过 apache:apache,不知何故它起作用了。但是现在我遇到了另一个问题:
PrestaShop 安装需要在文件夹 var/cache 中写入关键文件。请检查您服务器上的权限。
正在安装 Prestashop 1.7.6.2 发生错误:
You need to grant write permissions for PHP on the following directory: /var/www/html/presta
安装 Prestashop 时出现此错误。它停留在 0%。
我有:
- centos 7
- PHP 7.3.14
如果您使用的是 apache,则将 var/www/html/presta 所有者更改为 www-data,如果您使用的是 nginx,则更改为 nginx。
chown -R www-data:www-data /var/www/html/presta
但不要将权限更改为 777,因为这会完全打开您的站点,而是将目录更改为 0755,将文件更改为 0644。
内部商店根文件夹:
find . -type f -exec chmod 644 -- {} +
为所有文件设置适当的权限
find . -type d -exec chmod 755 -- {} +
为所有目录设置适当的权限
chmod 666 .htaccess
为 .htaccess 设置适当的权限
我用过 apache:apache,不知何故它起作用了。但是现在我遇到了另一个问题: PrestaShop 安装需要在文件夹 var/cache 中写入关键文件。请检查您服务器上的权限。