当我上传视频大小17MB时,那图显示错误,我已将php.ini设置为post_max_size = 1500M(CLI)和fpm 800M。但是当我在laravel中运行时,报错。我应该怎么做? 。当我在浏览器中运行phpinfo.php时,post_max_size显示1G或1000M。请帮助我。.我在另一个问题stackoverflow上搜索了相同的问题,但这对我没有帮助。
这是我的视频播放器控制器
public function add_video(Request $request)
{
// return $request->all();
$this->validate($request, [
'tittle_video' => 'required',
'keterangan_video' => 'required',
'poster_file' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'video_file' => 'required|mimes:mp4,avi,mpeg,webm,wmv,3gp,avi,mov,rm,mpg,ogg,qt|max:750000',
'channelid' => 'required|numeric'
]);
$cariChannel = Project::findOrFail($request->channelid);
if($request->hasFile('poster_file') && $request->hasFile('video_file')){
$image = $request->file('poster_file');
$name = time().'.'.$image->getClientOriginalExtension();
$destinationPathPoster = public_path($cariChannel->url_project);
$video = $request->file('video_file');
$nameVid = time().'.'.$video->getClientOriginalExtension();
$destinationPathVideo = public_path($cariChannel->url_project);
// $image->move($destinationPath, $name);
$insert = Video::create([
'project_id' => $cariChannel->id,
'title_video' => $request->tittle_video,
'description_video' => $request->keterangan_video,
'source_video' => $cariChannel->url_project."/".$nameVid,
'source_poster' => $cariChannel->url_project."/".$name,
]);
$insertPoster = $image->move($destinationPathPoster, $name);
$insertVideo = $video->move($destinationPathVideo, $nameVid);
if($insert && $insertPoster && $insertVideo){
return redirect('/vendor/profile')->with('success','Success added new videos!');
}else{
return redirect('/vendor/profile')->with('failed','Failed add new video');
}
}
}
我已经设置了php.ini,但上传视频8MB或上传失败时。