Nginx+;PHP文件上载问题

Nginx+;PHP文件上载问题,php,linux,nginx,Php,Linux,Nginx,我在通过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

我在通过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...
我正在运行CentOS Linux 7.2.1511版(Core),其中包含Nginx 1.8.0和PHP 5.4.16。此安装程序在从CentOS 7.1更新到7.2之前运行

以下是我已经尝试解决问题的步骤:

  • 系统获取临时目录()->/tmp
  • /tmp拥有1777权限
  • PHP正在以用户nginx的身份运行
  • 它有足够的可用磁盘空间
  • post_max_size、upload_max_filesize和client_max_body_size都设置为50m
我的想法快用完了

提前感谢

简单解决方案:

$ sudo systemctl restart php-fpm nginx

解决了这个问题。我不知道为什么,但现在它工作起来很有魅力。

几乎可以肯定,有人删除了在/tmp区域中创建的目录,该目录用于这些进程nginx和php fpm的写入。然后进程尝试写入不存在的目录。重新启动它们会重新创建目录,从而使其再次工作。