Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:E:PHP zip包无法定位_Php_Ubuntu - Fatal编程技术网

PHP:E:PHP zip包无法定位

PHP:E:PHP zip包无法定位,php,ubuntu,Php,Ubuntu,我试图在Ubuntu服务器18.04中安装Laravel,我已经安装了Apache2、PHP和MySQL服务器 这些版本如下: Apache2: Server version: Apache/2.4.29 (Ubuntu) Server built: 2019-04-03T13:22:37 PHP: 但是,当我尝试使用Composer安装Laravel时,出现以下错误: Problem 1 - Installation request for laravel/installer ^

我试图在Ubuntu服务器18.04中安装Laravel,我已经安装了Apache2、PHP和MySQL服务器

这些版本如下:

Apache2:

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

但是,当我尝试使用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.
我读到这样做可以解决问题:

将解决此问题,但我在尝试安装其中一个时有以下输出:

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

正如您所说,使用apt get安装php7.2-zip。您的错误消息表明您使用了apt get安装php-zip。apt-get多年来已演变为仅使用apt。在现代系统上,这将检测php版本等。请尝试apt安装php zip,如果您的权限被拒绝,那就用它试试吧sudo@miken32我使用了这两个选项,并且出现了相同的错误…@TarekAdam我使用了sudo-apt-install-php-zip,错误与使用sudo-apt-get-install-php-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