【发布时间】:2019-09-25 13:31:05
【问题描述】:
我正在尝试在 Ubuntu Server 18.04 中安装 Laravel,并且我已经安装了 Apache2、PHP 和 MySQL Server。
这些是版本:
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
但是当我尝试使用Composer 安装 Laravel 时,出现以下错误:
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.
我读到通过这样做解决了这个问题:(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
会解决问题,但是当我尝试安装其中一个时,我有这个输出:
Reading list of packages ... Done
Creating dependency tree
Reading the status information ... Done
E: The php-zip package could not be located
知道我做错了什么吗?
谢谢!
【问题讨论】:
-
如你所说,使用
apt-get install php7.2-zip。您的错误消息表明您使用了apt-get install php-zip。 -
apt-get 多年来已经演变成 apt。在现代系统上,这将检测 php 版本等。尝试 apt install php-zip 如果您的权限被拒绝,请尝试使用 sudo
-
@miken32 我用了它们,同样的错误......
-
@TarekAdam 我使用了 sudo apt install php-zip 和使用 sudo apt-get install php-zip 的错误