安装drupal模块时文件系统权限错误
当我尝试通过“安装新模块”表单将新模块安装到 drupal 7 时,我收到以下错误消息。
- 指定文件 临时://fileTFJ015 无法 已复制,因为目的地 目录配置不正确。 这可能是由以下问题引起的 文件或目录权限。更多的 信息可在 系统日志。
- http://ftp.drupal.org/files /projects/date-7.x-1.0-alpha2.tar.gz 无法保存到 临时://update-cache/date-7.x-1.0-alpha2.tar.gz。
- 无法检索 Drupal 项目 从 http://ftp.drupal.org/files /projects/date-7.x-1.0-alpha2.tar.gz。
我的 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.
- The specified file
temporary://fileTFJ015 could not be
copied, because the destination
directory is not properly configured.
This may be caused by a problem with
file or directory permissions. More
information is available in the
system log. - http://ftp.drupal.org/files/projects/date-7.x-1.0-alpha2.tar.gz
could not be saved to
temporary://update-cache/date-7.x-1.0-alpha2.tar.gz. - Unable to retrieve Drupal project
from
http://ftp.drupal.org/files/projects/date-7.x-1.0-alpha2.tar.gz.
My Drupal 7 is installed with CPanel QuickInstall tool and hosted with HostGator shared hosting service.
Any ideas how to solve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
共享主机和临时文件夹存在问题...如果您需要背景信息,可以阅读以下内容:
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
处理此问题的最快方法是通过 Web 浏览器导航至:
您可能会看到有关无法写入 /tmp 目录的错误。要解决此问题,您可以在站点的根目录下创建一个临时目录并适当地设置权限。
1) 在此处创建一个目录 [drupal_installed_here]/tmp
2) 通过网络浏览器导航至 /admin/config/media/file-system 并将临时目录更改为:
tmp 而不是 /tmp(无前导斜杠)
3) 尝试此命令:
并刷新 /admin/config/media/file-system 页面
3) 如果这不起作用,请尝试此命令:
并刷新 /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:
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:
and refresh the /admin/config/media/file-system page
3) If that does not work, try this command:
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.
尽管互联网上有几个与之相关的线程,但这个错误花了我很长时间才弄清楚。
如果您在页面上遇到此错误,则需要执行以下步骤来解决该错误:
转到“管理”->“报告”->“最近日志消息”。阅读最新的错误消息。这将告诉您哪个文件夹导致了问题。它不一定是有关该主题的在线线程中列出的目录。对我来说是:sites/default/files/js
如果您在 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:
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
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.
我的旧的、有问题的配置:
我的新的、功能性配置:
My old, problematic configuration:
My new, functional configuration:
请不要使用777权限,因为你会遇到安全问题。 775就可以了。
如果您打开了 javascript 缓存,您可能需要 755 /sites/all/your-theme/js
Please do not use 777 permissions, because you will have security problems. 775 will do just fine.
If you have javascript caching turned on, you might need to 755 the /sites/all/your-theme/js
为我解决了这个问题
solved the issue for me