Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在nginx服务器上上载120mb文件时获取CannotWriteFileException_Php_Laravel_Ubuntu_Nginx_Laravel 7 - Fatal编程技术网

Php 在nginx服务器上上载120mb文件时获取CannotWriteFileException

Php 在nginx服务器上上载120mb文件时获取CannotWriteFileException,php,laravel,ubuntu,nginx,laravel-7,Php,Laravel,Ubuntu,Nginx,Laravel 7,我在Ubuntu+Nginx服务器上有一个Laravel7项目。我可以上传小于10mb的文件,但当我试图上传120mb的文件时,我遇到了一个错误。我已经在php.ini中更改了内存限制、上传最大文件大小、发布大小到640mb。这没有帮助。我还将重新启动php fpm和nginx服务 错误日志 问题在于服务器内存不足。在我将它从5GB增加到10GB之后,就没有问题了。但在此之前,大约有200MB,我试图上传一个100MB的视频在更改设置以便应用新配置后,您是否重新启动了php进程?@codedg

我在Ubuntu+Nginx服务器上有一个Laravel7项目。我可以上传小于10mb的文件,但当我试图上传120mb的文件时,我遇到了一个错误。我已经在php.ini中更改了内存限制、上传最大文件大小、发布大小到640mb。这没有帮助。我还将重新启动php fpm和nginx服务

错误日志
问题在于服务器内存不足。在我将它从5GB增加到10GB之后,就没有问题了。但在此之前,大约有200MB,我试图上传一个100MB的视频

在更改设置以便应用新配置后,您是否重新启动了php进程?@codedge是的,我重新启动了php fpm和nginx另一个想法是检查nginx的
客户端最大身体大小
设置。如果日志中有更多详细信息,您还应该检查您的php日志。它们主要位于ad
/var/log/nginx/*
,主要在vhost文件中定义。@codedge client_max_body_size已经增加了它。让我查一下日志files@codedge添加日志内容
2021/01/21 21:11:51 [warn] 13069#13069: *1 a client request body is 
buffered to a temporary file /var/lib/nginx/body/0000000001, client: 92.47.198.158, server: servername, request: "POST /courseclass/17 HTTP/2.0", host: "servername", referrer: "https://servername/courseclass/17"
2021/01/21 21:11:53 [error] 13069#13069: *1 openat() "/var/www/servername/video/class/video_course_1611240590.mp4" failed (2: No such file or directory), client: 92.47.198.158, server: servername, request: "GET /video/class/video_course_1611240590.mp4 HTTP/2.0", host: "servername", referrer: "https://servername/watch/course/6"
2021/01/21 21:11:54 [error] 13069#13069: *1 openat() "/var/www/servername/video/class/video_course_1611240590.mp4" failed (2: No such file or directory), client: 92.47.198.158, server: servername, request: "GET /video/class/video_course_1611240590.mp4 HTTP/2.0", host: "servername", referrer: "https://servername/watch/course/6"
2021/01/21 21:41:18 [error] 13069#13069: *8 openat() "/var/www/servername/images/light.jpg" failed (2: No such file or directory), client: 92.47.149.211, server: servername, request: "GET /images/light.jpg HTTP/2.0", host: "servername", referrer: "https://servername/"
2021/01/21 21:41:21 [error] 13069#13069: *8 openat() "/var/www/servername/images/light.jpg" failed (2: No such file or directory), client: 92.47.149.211, server: servername, request: "GET /images/light.jpg HTTP/2.0", host: "servername", referrer: "https://servername/"

    2021/01/21 21:49:53 [warn] 13069#13069: *10 an upstream response is 
buffered to a temporary file /var/lib/nginx/fastcgi/3/00/0000000003 while reading upstream, client: 92.47.198.158, server: servername, request: "POST /courseclass/17 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/servername.sock:", host: "servername", 
referrer: "https://servername/courseclass/17"