安装drupal模块时文件系统权限错误

发布于 2024-10-18 09:50:14 字数 648 浏览 3 评论 0原文

当我尝试通过“安装新模块”表单将新模块安装到 drupal 7 时,我收到以下错误消息。

我的 Drupal 7 使用 CPanel QuickInstall 工具安装,并使用 HostGator 共享托管服务托管。 有什么想法如何解决这个问题吗?

When I try to install new modules to drupal 7 via "Install new module" form, I get following error message.

My Drupal 7 is installed with CPanel QuickInstall tool and hosted with HostGator shared hosting service.
Any ideas how to solve this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

梦过后 2024-10-25 09:50:14

共享主机和临时文件夹存在问题...如果您需要背景信息,可以阅读以下内容:

http:// drupal.org/node/1008328

同时尝试将您的 tmp 文件夹更改为相对于您的站点文件根目录:

sites/default/files/temp

There is an issue with shared hosts and temp folders...if you want the background you can read this:

http://drupal.org/node/1008328

in the meantime try changing your tmp folder to be relative to your sites file root:

sites/default/files/temp

过度放纵 2024-10-25 09:50:14

处理此问题的最快方法是通过 Web 浏览器导航至:

/admin/config/media/file-system

您可能会看到有关无法写入 /tmp 目录的错误。要解决此问题,您可以在站点的根目录下创建一个临时目录并适当地设置权限。

1) 在此处创建一个目录 [drupal_installed_here]/tmp

2) 通过网络浏览器导航至 /admin/config/media/file-system 并将临时目录更改为:

tmp 而不是 /tmp(无前导斜杠)

3) 尝试此命令:

chmod 775 [drupal_istalled_here]/tmp

并刷新 /admin/config/media/file-system 页面

3) 如果这不起作用,请尝试此命令:

chmod 777 /home/quickstart/websites/tmp

并刷新 /admin/config /media/file-system page

最后一个命令会大量打开您的临时目录权限(rwxrwxrwx),但有时这是让您的站点在共享主机上运行所必需的。

The quickest way to get a handle on this issue is to navigate via your web browser to:

/admin/config/media/file-system

You'll probably see an error there about not being able to write to the /tmp directory. To fix this, you can create a temp directory under site's root and set permissions appropriately.

1) Create a directory here [drupal_installed_here]/tmp

2) Navigate via your web browser to /admin/config/media/file-system and change the temp directory to be:

tmp instead of /tmp (no leading slash)

3) Try this command:

chmod 775 [drupal_istalled_here]/tmp

and refresh the /admin/config/media/file-system page

3) If that does not work, try this command:

chmod 777 /home/quickstart/websites/tmp

and refresh the /admin/config/media/file-system page

The last command opens up your temp directory permissions a lot (rwxrwxrwx), but sometimes that's necessary to get your site working on shared hosts.

心奴独伤 2024-10-25 09:50:14

尽管互联网上有几个与之相关的线程,但这个错误花了我很长时间才弄清楚。

如果您在页面上遇到此错误,则需要执行以下步骤来解决该错误:

  1. 转到“管理”->“报告”->“最近日志消息”。阅读最新的错误消息。这将告诉您哪个文件夹导致了问题。它不一定是有关该主题的在线线程中列出的目录。对我来说是:sites/default/files/js

  2. 如果您在 Linux 服务器上运行 Drupal,那么您需要向问题文件夹添加读/写权限。您可以通过转到 linux/SSH 命令行并键入以下内容(将文件夹地址替换为您的文件夹地址)来完成此操作

chmod 777 /var/www/html/sites/default/files/js

就是这样。错误消息现在应该消失了。

This error took me a long time to figure out despite several threads on the internet related to it.

If you get this error on a page, then here are the steps that you need to follow to solve it:

  1. Go to Admin->Reports->Recent Log Messages. Read the most recent error message. This will tell you which folder is causing the problem. It is not necessarily the directory listed in the online threads about this subject. For me it was: sites/default/files/js

  2. If you are running Drupal on a linux server then you need to add read/write permissions to the problem folder. You can do this by going to the linux/SSH command line and typing the following (replace the folder address with the address for your folder)

chmod 777 /var/www/html/sites/default/files/js

That's it. The error message should be gone now.

九公里浅绿 2024-10-25 09:50:14

我的旧的、有问题的配置:

chmod 664 -R /var/drupal-bc/sites/default/files
chmod 664 -R /var/drupal-bc/sites/default/private

drw-rw-r-- 2 www-data www-data  4096 Jul 31 12:35 files
drw-rw-r-- 3 www-data www-data  4096 Jul  5 15:08 private

我的新的、功能性配置:

chmod 774 -R /var/drupal-bc/sites/default/files
chmod 774 -R /var/drupal-bc/sites/default/private

drwxrwxr-- 2 www-data www-data  4096 Jul 31 12:35 files
drwxrwxr-- 3 www-data www-data  4096 Jul  5 15:08 private

My old, problematic configuration:

chmod 664 -R /var/drupal-bc/sites/default/files
chmod 664 -R /var/drupal-bc/sites/default/private

drw-rw-r-- 2 www-data www-data  4096 Jul 31 12:35 files
drw-rw-r-- 3 www-data www-data  4096 Jul  5 15:08 private

My new, functional configuration:

chmod 774 -R /var/drupal-bc/sites/default/files
chmod 774 -R /var/drupal-bc/sites/default/private

drwxrwxr-- 2 www-data www-data  4096 Jul 31 12:35 files
drwxrwxr-- 3 www-data www-data  4096 Jul  5 15:08 private
執念 2024-10-25 09:50:14

请不要使用777权限,因为你会遇到安全问题。 775就可以了。

chmod 775 -R /var/drupal-bc/sites/default/files
chmod 775 -R /var/drupal-bc/sites/default/private

如果您打开了 javascript 缓存,您可能需要 755 /sites/all/your-theme/js

Please do not use 777 permissions, because you will have security problems. 775 will do just fine.

chmod 775 -R /var/drupal-bc/sites/default/files
chmod 775 -R /var/drupal-bc/sites/default/private

If you have javascript caching turned on, you might need to 755 the /sites/all/your-theme/js

邮友 2024-10-25 09:50:14
chmod 777 /var/www/html/sites/default/files/js

为我解决了这个问题

chmod 777 /var/www/html/sites/default/files/js

solved the issue for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文