duancheng6221 2017-07-27 06:19
浏览 405
已采纳

Lychee:文件上传错误 - 无法在第0行的Unknown中创建临时文件

I'm running Lychee on my server (photo hosting software). Everything works fine except the image upload. I get the following error:

PHP message: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0" while reading response header from upstream, client: 123.123.12.12, server: example.com, request: "POST /php/index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "example.com", referrer: "example.com/"

2017/07/27 08:03:51 [error] 10711#10711: *183 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/) in Unknown on line 0

The error still exists after adding "/tmp" to "open_basedir"

open_basedir = "/var/www/:/tmp/"

And adding a tmp dir with www-http rights in /tmp

upload_tmp_dir = /tmp/http-upload
  • 写回答

1条回答 默认 最新

  • dongse5528 2017-07-31 05:56
    关注

    I had to add the open_basedir parameter in nginx

    location ~ \.php$ {
                    try_files  $uri =404;
                    fastcgi_pass 127.0.0.1:9000;
                    fastcgi_param PHP_VALUE open_basedir="/var/www/:/tmp/";
                    fastcgi_index  index.php;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                    fastcgi_param  SCRIPT_NAME  $fastcgi_script_name;
                    include fastcgi_params;
            }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器