当我无法将文件上传到文件字段 CCK 字段时,我应该检查什么?

发布于 2024-09-24 13:21:32 字数 658 浏览 2 评论 0原文

我最近移动了一个 drupal 站点。 (两台服务器都运行在基于 debian 的 LAMP 堆栈上)这里一切都运行良好,包括通过 CCK 文件字段上传图像。原文网址: dev.example.com/foo

将其部署到生产服务器上的测试文件夹,以进行环境安定巡航的测试文件夹将其引导到此处: www.example.com/foo

这里一切都正常,包括图像上传。调整sites/default/settings.php,然后再次将其设为只读后,我将该文件夹重命名为其生产名称: www.example.com/bar

除了图像上传之外,这里一切正常。我已经调整了 settings.php 中的 webroot 变量。

到目前为止我尝试过的事情:

  • 授予 php 系统用户对站点/默认/文件的写入权限(图像设置为进入站点/默认/文件/图像,但 imagecache 只是将它们放入站点/默认/文件)
  • 启用文件 php 文件上传对于 www.example.com/bar/sites/default/files

是否还有其他我应该注意的配置设置?我缺乏相关的解决方案。

编辑:我在那里有一个拼写错误,我调整了sites/default/settings.php,而不是sites/default.settings.php。

I have recently moved a drupal site. (both servers run on a debian based LAMP stack) Everything works great here, including the uploading of images via a CCK filefield. Original url:
dev.example.com/foo

Deploying it to a test folder on the production server to a test folder for an environmental shakedown cruise lead it here:
www.example.com/foo

Everything works here too, including image uploads. After adjusting sites/default/settings.php, then making it readonly again, I renamed the folder to its production name:
www.example.com/bar

Everything works fine here except for image uploading. I've adjusted the webroot variable within settings.php .

Things I have tried so far:

  • Gave php system user write permissions to sites/default/files (images are set to go in sites/default/files/images but imagecache just puts them in sites/default/files)
  • Enabled file php file uploading for www.example.com/bar/sites/default/files

Are there any other configuration settings I should be looking out for here? I'm running low on relevant solutions.

Edit: I had quite the typo there, I adjusted sites/default/settings.php, not sites/default.settings.php .

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

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

发布评论

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

评论(2

作妖 2024-10-01 13:21:32

你的问题有点令人困惑。 default.settings.php 对 Drupal 没有影响——它只是一个模板。包含实际数据库连接信息和其他配置的文件是settings.php

您可能还想查看 Drupal 根文件夹中的 .htaccess 文件,并尝试将 RewriteBase 指令更改为您正在访问站点的文件夹。通常,您不必更改您可能/可能未更改的 settings.php 文件中的 $base_url 指令。如果有的话,请立即撤消该更改(不过您可能需要稍后再尝试)。

imagecache 将始终将图像衍生物上传到 sites/default/files 中,但 imagefield 会将原始图像上传到 you 指定(在 sites/default/files 内)。您将在“管理字段”->“图像字段名称”->“路径设置”下的“配置”下获得图像字段的设置。

请谷歌了解 imagecache 和 imagefield 之间的区别。确保您的 sites/default/files (和子文件夹)可由 apache 用户(通常是 www-data)写入。

在这种情况下,通常最好拿起一本有关 apache 的书(如果您还没有)并尝试了解它是如何工作的。这将非常耗时,但会在您将来遇到此类配置问题时为您提供帮助。

Your question is slightly confusingly framed. default.settings.php has no impact on Drupal -- its merely a template. The file that contains the actual database connection information and other configuration is settings.php.

You may also want to look at your .htaccess file in your root Drupal folder and try changing the RewriteBase directive to the folder you are accessing your site on. Usually you should not have to change the $base_url directive in the settings.php file that you may/may not have done. Reverse that change for now if you have (you may need to play around with that later though).

imagecache will always upload the image derivatives in sites/default/files but imagefield will upload the original image in the folder you specify (within sites/default/files). You will get a setting for the imagefield under Manage Fields->[Name of Image field]->Configure under Path Settings.

Please google to understand the difference between imagecache and imagefield. Make sure your sites/default/files (and subfolders) are writable by the apache user (usually www-data).

In such situations, its usually a good idea to pick up a book on apache (if you haven't already) and try to understand how it works. It will be time consuming but will help you out in the future when you encounter configuration issues like this.

吻安 2024-10-01 13:21:32

这对我有用。当将图像上传到 cck 字段时遇到问题时,我向目录授予了写入权限:

站点/默认/文件/字段/图像

This worked for me. When having issues uploading images to a cck field, I gave write permissions to directory:

sites/default/files/field/image

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