在 Ubuntu 上的 php 5.6 上安装 php-zip
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38104348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install php-zip on php 5.6 on Ubuntu
提问by Anthony
I can't install php-zip on my Ubuntu VM with the last php5.6.
我无法使用最新的 php5.6 在我的 Ubuntu VM 上安装 php-zip。
Can't find find anything clear on it.
找不到任何明确的内容。
I still get that Apache error :
我仍然收到那个 Apache 错误:
PHP Fatal error: Class 'ZipArchive' not found in /var/www/uta/system/library/PHPExcel/PHPExcel/Writer/...
Thanks
谢谢
回答by Gareth Parker
Try either
尝试
sudo apt-get install php-zip
orsudo apt-get install php5.6-zip
sudo apt-get install php-zip
或者sudo apt-get install php5.6-zip
Then, you might have to restart your web server.
然后,您可能需要重新启动 Web 服务器。
sudo service apache2 restart
orsudo service nginx restart
sudo service apache2 restart
或者sudo service nginx restart
If you are installing on centos or fedora OS then use yum in place of apt-get. example:-
如果您在 centos 或 fedora 操作系统上安装,则使用 yum 代替 apt-get。例子:-
sudo yum install php-zip
or
sudo yum install php5.6-zip
and
sudo service httpd restart
sudo yum install php-zip
或
sudo yum install php5.6-zip
和
sudo service httpd restart