我正在尝试在 Ubuntu Server 18.04 中安装 Laravel,并且我已经安装了 Apache2、PHP 和 MySQL Server。
这些是版本:
Apache 2:
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
知道我做错了什么吗?
谢谢!
最佳答案
使用这些命令解决了这个问题:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
sudo apt-get install php7.2-zip
关于PHP: E: 找不到 php-zip 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56030168/