Cow*_*irl 2 php permissions laravel
在我的服务器中,我收到此错误消息
Unable to write in the "/home/company/blog/public/img" directory
Run Code Online (Sandbox Code Playgroud)
当我尝试在控制器中上传这样的图像时
$file = $request->file('img');
$name = time() . '-' . $file->getClientOriginalName();
$file->move(public_path() .'/img/', $name);
$company = company::where('username', $username)->first();
$company->images()->create(['path' => "/{$name}"]);
Run Code Online (Sandbox Code Playgroud)
我知道这是关于授予我尝试过的权限
chmod 755 /home/company/blog/public/img
Run Code Online (Sandbox Code Playgroud)
但它仍然不起作用。
我该如何解决这个问题?
| 归档时间: |
|
| 查看次数: |
7212 次 |
| 最近记录: |