【发布时间】:2016-04-09 08:28:34
【问题描述】:
我在通过 phpMyAdmin、MODx 或 Wordpress 上传文件时遇到以下问题。在 PHP 应用程序本身中,我收到一条成功消息,但未上传文件。 nginx error.log 打印以下消息:
[warn][..] a client request body is buffered to a temporary file...
FastCGI sent in stderr: "PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0...
我正在运行带有 Nginx 1.8.0 和 PHP 5.4.16 的 CentOS Linux 版本 7.2.1511(核心)。此设置在从 CentOS 7.1 更新到 7.2 之前有效。
以下是我已经尝试解决问题的步骤:
- sys_get_temp_dir() -> /tmp
- /tmp 权限为 1777
- PHP 正在以用户 nginx 运行
- 有足够的可用磁盘空间
- post_max_size、upload_max_filesize 和 client_max_body_size 都设置为 50m
我的想法不多了……
提前致谢
【问题讨论】: