Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.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
无法打开/var/folders/n\u/laravel-excel.maatwebsite_Laravel_Maatwebsite Excel_Laravel Excel - Fatal编程技术网

无法打开/var/folders/n\u/laravel-excel.maatwebsite

无法打开/var/folders/n\u/laravel-excel.maatwebsite,laravel,maatwebsite-excel,laravel-excel,Laravel,Maatwebsite Excel,Laravel Excel,我想使用laravel-excel.maatwebsitelibrary创建下载excel函数。我的代码如下所示: return Excel::download(new PembukuanExport, 'pembukuan.xlsx'); 但当我运行它时,它给了我这样的错误 无法打开/var/folders/n\ux/xh\u 10hm50dvbwg23cfq\u kw3h0000gn/T/laravel-excel-DMBN3reNUrSiamYT进行写入 我的笔记本电脑是macbook

我想使用laravel-excel.maatwebsitelibrary创建下载excel函数。我的代码如下所示:

return Excel::download(new PembukuanExport, 'pembukuan.xlsx');
但当我运行它时,它给了我这样的错误

无法打开/var/folders/n\ux/xh\u 10hm50dvbwg23cfq\u kw3h0000gn/T/laravel-excel-DMBN3reNUrSiamYT进行写入


我的笔记本电脑是macbook,一直在谷歌上搜索,但找不到正确的答案

我通过在“httpd.conf”中更改
用户和组
解决了这个问题

  • 打开
    httpd.config
  • 搜索关键字“用户或组”并更改它
  • 使用您的\u mac\u用户
    并填写
    集团员工

  • 回答这个问题可能太晚了,但我想您需要配置
    excel.php
    config文件

    发布excel配置文件:

    php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"
    
    现在,在
    config/excel.php
    文件中,您需要进行配置:

    'temporary_files' => [
    
        /*
        |--------------------------------------------------------------------------
        | Local Temporary Path
        |--------------------------------------------------------------------------
        |
        | When exporting and importing files, we use a temporary file, before
        | storing reading or downloading. Here you can customize that path.
        |
        */
        'local_path'  => storage_path(),
    
        /*
        |--------------------------------------------------------------------------
        | Remote Temporary Disk
        |--------------------------------------------------------------------------
        |
        | When dealing with a multi server setup with queues in which you
        | cannot rely on having a shared local temporary path, you might
        | want to store the temporary file on a shared disk. During the
        | queue executing, we'll retrieve the temporary file from that
        | location instead. When left to null, it will always use
        | the local path. This setting only has effect when using
        | in conjunction with queued imports and exports.
        |
        */
        'remote_disk' => null,
    
    ],
    

    这会将临时文件夹设置为您有权执行操作的存储路径。希望这对其他人有帮助。

    检查此文件夹是否可写?提供对此文件夹的写入权限。该文件夹是可写的,我对该文件夹进行了chmod,但仍有错误。是否有任何方法可以更改该写入文件夹?尝试将chmod-R 775指定给该文件夹?我遇到了同样的问题,并找到了您的答案。我已经发布了您建议的excel配置,但即使在运行
    php-artisan-config:cache
    命令之后,仍然存在相同的错误。这是当前部分
    'local\u path'=>storage\u path('framework/laravel excel'),
    关于如何修复它的更多提示?非常感谢,非常感谢。