简体   繁体   English

未找到Laravel excel Class'ZipArchive'

[英]Laravel excel Class 'ZipArchive' not found

I have laravel project with ability to upload data to mysql from .csv file using laravel-excel plugin. 我有laravel项目能够使用laravel-excel插件从.csv文件上传数据到mysql。

When I try to upload data to mysql from .csv file, I get error "Class 'ZipArchive' not found". 当我尝试从.csv文件上传数据到mysql时,我收到错误“未找到Class'ZipArchive'”。 Can't understand what 'zip' has to do with it, if I use .csv I am using: VMware Debian server, PHP 7.1 无法理解'zip'与它有什么关系,如果我使用.csv我正在使用:VMware Debian服务器,PHP 7.1

Everything works fine on my PC, localhost. 在我的电脑localhost上一切正常。

This happens when you have not installed the zip-extension. 如果您尚未安装zip扩展,则会发生这种情况。

you can install it like 你可以安装它

sudo apt-get install php7.1-zip

after installing make sure restart the server. 安装后确保重启服务器。

Hope this helps. 希望这可以帮助。

Laravel-excel uses Phpspreadsheet which has the php_zip extension as a requirement. Laravel-excel使用Phpspreadsheet,它具有php_zip扩展名作为要求。 If you're only using it for CSV parsing, are you sure you need the entire laravel-excel plugin? 如果你只是用它来进行CSV解析,你确定需要整个laravel-excel插件吗?

The solution is to install php-zip on your debian server or use a different method of parsing your CSVs. 解决方案是在您的debian服务器上安装php-zip或使用不同的方法解析您的CSV。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM