1

我成功在网络主机中安装了 Drupal 7。安装模块后,我收到一个错误错误,并且状态报告给了我这个错误消息:

File system Not writable
The directory /Applications/MAMP/tmp/php does not exist.
You may need to set the correct directory at the file system settings page or
change the current directory's permissions so that it is writable.

我检查了权限(sites/default/files),它有755 个权限,我将其更改为777,但什么也没发生,所以我将其退回。

我有以下设置(Home » Administration » Configuration » Media):

Public file system path
sites/default/files

Temporary directory
/Applications/MAMP/tmp/php

这是我得到的错误:

Warning: file_put_contents(temporary://fileDyFbDg) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1898 of /home/imamus/public_html/includes/file.inc).
The file could not be created.
Warning: file_put_contents(temporary://fileeTFMpl) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1898 of /home/imamus/public_html/includes/file.inc).
The file could not be created.
Warning: file_put_contents(temporary://fileuB8Tdu) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1898 of /home/imamus/public_html/includes/file.inc).
The file could not be created.
Warning: file_put_contents(temporary://filea1KYXG) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1898 of /home/imamus/public_html/includes/file.inc).
The file could not be created.

请指教。

4

3 回答 3

2

此回复适用于非 Windows 站点:
在我的情况下,sites/default/files/ 文件夹设置为 775(将其设置为 777 不是一个好主意)
我不得不删除以下文件夹:

rm -rf /tmp/devel_themer/

然后它起作用了!

于 2015-02-22T13:07:44.340 回答
2

我检查了(站点/默认/文件)的权限,它有 755 个权限,我将其更改为 777,但什么也没发生,所以我将其退回。

做同样的事情/Applications/MAMP/tmp/php

于 2013-07-07T09:48:28.123 回答
0

发生错误是因为您的临时目录不可由您的 Web 服务器用户写入。

您可以在管理面板中查看报告状态报告,网址为:/admin/reports/status

要修复它,您必须在Configuration (at ) 中进入File system,然后将临时目录更改为指向您的可写目录。如果这是正确的,那么让你设置正确的权限,例如/admin/config/media/file-system

sudo chmod -R 777 /Applications/MAMP/tmp/php

和默认文件夹相同:

sudo chmod -R 777 sites/default/files

德鲁什

如果您正在使用drush,请检查当前设置的文件夹:

drush vget file_temporary_path

然后要修复它,请尝试:

drush vset file_temporary_path /tmp

以下是默认临时目录:

  • OS X: /private/tmp, 对于 MAMP:/Applications/MAMP/tmp/php
  • Linux/Unix:/tmp
于 2016-03-20T18:41:11.730 回答