我在Ubuntu 14.04上安装了Roundcube,使用NGINX,使用静态IP,SpamAssassin,ClamAV。 发送/接收电子邮件是好的,包括下载,但不能上传任何东西发送。
php.ini文件
memory_limit = 256M max_execution_time = 60 ;open_basedir = log_errors = On post_max_size = 100M file_uploads = On upload_tmp_dir = /tmp upload_max_filesize = 100M
文件夹权限
/tmp srw-rw---- 1 nginx nginx /roundcube/temp drwxrwxrwx 2 nginx nginx 4096 Feb 20 00:41 temp
在nginx.conf中,在http
指令下,我已经设置好了
client_max_body_size 100m;
-note:输出下面我删除了域名和目录名称。
FastCGI在stderr中发送:“PHP消息:PHP警告:file upload错误 – 无法在第0行的Unknown中创build一个临时文件”,同时从上游读取响应头,客户端:XXXX server:domain.com,请求:“POST / mail /?_ task = mail&_id = ~~~ from = compose&_action = upload HTTP / 1.1“,upstream:”fastcgi:// unix:/tmp/php5-fpm.sock:“,host:”domain.com“,referrer: https://domain.com/mail/?_task=mail&_action=compose&_id:~~~~
我已经设置邮件/临时文件夹为777只是为了看看它会写在那里的文件,它做到了,但是Roundcube仍然给出错误“file upload失败”。 通常情况下,该目录/mail/temp
设置为755,将写入0kb文件,而不是777文件实际上将被写入,但在圆形方块中的错误保持不变。
我也玩弄了根(PHP指向)/ tmp目录权限来看看是777会帮助(所有提到的文件都可以通过nginx:nginx访问)…没有喜悦,由Roundcube输出相同的错误:“file upload失败”。 作为最后的手段,我指出PHP到相同的/邮件/温度,看看是否会写,它做了,但仍然相同roundcube错误“file upload失败”。
我怎样才能解决这个上传问题?
重新启动这两个服务
$ sudo service php-fpm restart $ sudo service nginx restart