2017-03-28 45 views
2

我使用拉链laravel 5.3创建压缩文件, 得到错误的,laravel错误:你的PHP版本不支持ZIP编译

Error: Your PHP version is not compiled with zip support

PHP版本:5.6

chmod($withdrawalFilePath, 0777); 
$files = glob($withdrawalFilePath . '/*'); 
Zipper::make($withdrawalFilePath . '/Withdrawal.zip')->add($files)->close(); 
chmod($withdrawalFilePath . '/Withdrawal.zip', 0777); 
+0

也许这可能有助于https://community.apachefriends.org/f/viewtopic.php?f=17&t=52369 –

+0

https://pecl.php.net/package/zip –

+0

你应该安装php-zip延期。你可以在Linux上用'apt-get install php7.0-zip'或'apt-get install php-zip'来做到这一点。 –

回答

2

我最近遇到了这个问题,并能够通过安装php-zip扩展来解决它。 确保您在安装扩展程序后重新启动apache,以便它将被正确加载。

我在运行amazon linux ami的亚马逊ec2实例上使用php 7。 我使用的命令是:

sudo yum install php70-zip && sudo service httpd restart

该命令将取决于PHP的版本和你有Linux发行版使用的是不同。

+0

我只能使用php 5.6 –

+0

@VivekChaudhari对于PHP 5.6,该包名为'php-zip' –