Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.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 图像不';t在Laravel中的正确位置上载_Php_Laravel_Laravel 5_Cpanel - Fatal编程技术网

Php 图像不';t在Laravel中的正确位置上载

Php 图像不';t在Laravel中的正确位置上载,php,laravel,laravel-5,cpanel,Php,Laravel,Laravel 5,Cpanel,我在我的Laravel项目中有一个图像上传表单 我想将上传的图像保存到public/images/位置 但是图像上传到公共/app/images位置 这个app来自哪里 config/filesystem.php 'disks' => [ 'local' => [ 'driver' => 'local', 'root' => public_path(''), ], 'public' => [ 'driver' => 'local'

我在我的Laravel项目中有一个图像上传表单

我想将上传的图像保存到
public/images/
位置

但是图像上传到
公共/app/images
位置

这个
app
来自哪里

config/filesystem.php

'disks' => [

 'local' => [
    'driver' => 'local',
    'root' => public_path(''),
],

'public' => [
    'driver' => 'local',
    'root' => public_path(''),
    'visibility' => 'public',
],

's3' => [
    'driver' => 's3',
    'key' => 'your-key',
    'secret' => 'your-secret',
    'region' => 'your-region',
    'bucket' => 'your-bucket',
  ],
],
控制器

if($this->request->hasFile('photo')) 
{
    $image_url = $this->request->photo->store('/images/campaign/large');

    $image = substr($image_url, strrpos($image_url, '/') + 1);
}
我在本地项目中应用了相同的代码。图片上传到正确的位置

但是这个问题发生在我的cPanel服务器项目中。我已经在live server中清除了现金


哪里出错了?

我想这个控制器代码对您有帮助

if($this->request->hasFile('photo')) 
{
    $image_url = $this->request->photo->store(public_path('images'));

    $image = substr($image_url, strrpos($image_url, '/') + 1);
}

我想这个控制器代码对你有帮助

if($this->request->hasFile('photo')) 
{
    $image_url = $this->request->photo->store(public_path('images'));

    $image = substr($image_url, strrpos($image_url, '/') + 1);
}

如果您使用linux或mac os,或者您无法清除缓存,因为昨天在我的办公室,您可以使用chmod-R 777来保存您的目录文件

本文件全文如下:

如果您使用linux或mac操作系统,或者您无法清除缓存,因为昨天在我的办公室,您可以使用chmod-R 777创建目录文件

本文件全文如下:

我认为您没有为存储路径创建符号链接。 请点击此链接:

简言之,你需要运行这个 php artisan存储:链接

我认为您没有为存储路径创建符号链接。 请点击此链接:

简言之,你需要运行这个 php artisan存储:链接

Hmm@Tarasovych…没有解决方案因此不需要重复问题Hmm@Tarasovych…没有解决方案因此不需要重复问题请进一步解释?那代码是做什么的?请记住,其他人应该能够从你的回答中学习。你能进一步解释一下吗?那代码是做什么的?记住,其他人应该能够从你的答案中学习