当我无法将文件上传到文件字段 CCK 字段时,我应该检查什么?
我最近移动了一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的问题有点令人困惑。
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 issettings.php
.You may also want to look at your
.htaccess
file in your root Drupal folder and try changing theRewriteBase
directive to the folder you are accessing your site on. Usually you should not have to change the$base_url
directive in thesettings.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 (withinsites/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.
这对我有用。当将图像上传到 cck 字段时遇到问题时,我向目录授予了写入权限:
This worked for me. When having issues uploading images to a cck field, I gave write permissions to directory: