无法打开的/ var /文件夹/ N_ / laravel-excel.maatwebsite

问题描述 投票:0回答:2

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

return Excel::download(new PembukuanExport, 'pembukuan.xlsx');

但是当我运行它,它给了我的错误是这样

无法打开的/ var /文件夹/ N_ / xh_10hm50dvbwg23cfq_kw3h0000gn / T / laravel-Excel的DMBN3reNUrSiamYT进行写入。

enter image description here

我的笔记本电脑是的MacBook,一直使用Google,但无法找到正确的答案

laravel maatwebsite-excel laravel-excel
2个回答
1
投票

我在httpd.conf中`改变User & Group解决了这个。

  1. 打开httpd.config
  2. 搜索关键字“用户或组”,并改变它。
  3. User your_mac_userGroup staff填写

0
投票

这可能是来不及回答这个问题,但我猜你需要配置excel.php配置文件。

发布的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,

],

这将设置临时文件夹具有执行权限的东西您的存储路径。希望这个发现帮助他人。

© www.soinside.com 2019 - 2024. All rights reserved.