douci2015 2019-05-07 20:39
浏览 96
已采纳

PHP:E:无法找到php-zip包

I'm trying to install Laravel in a Ubuntu Server 18.04 and I've already have installed Apache2, PHP and MySQL Server.

These are the versions:

Apache2:

Server version: Apache/2.4.29 (Ubuntu)
Server built:   2019-04-03T13:22:37

PHP:

PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.17-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

But when I tried to install Laravel with Composer I have the following error:

Problem 1
    - Installation request for laravel/installer ^2.1 -> satisfiable by laravel/installer[v2.1.0].
    - laravel/installer v2.1.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.

I've read that it's solved by doing this: (link)

sudo apt-get install php7.0-zip

# For php v7.1
sudo apt-get install php7.1-zip

# For php v7.2
sudo apt-get install php7.2-zip

Will solve the problem but I have this output when I try to install one of them:

Reading list of packages ... Done
Creating dependency tree
Reading the status information ... Done
E: The php-zip package could not be located

Any idea about what am I doing wrong?

Thanks!

  • 写回答

1条回答 默认 最新

  • duanfu5239 2019-05-08 20:05
    关注

    Using these commands solved the problem:

    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get install php7.2
    sudo apt-get install php7.2-zip
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵