[英]getting error while installing laravel in ubuntu
我有PHP版本:
php -v
PHP 7.1.9-1
作曲者版本:
Composer version 1.5.2 2017-09-11 16:59:25
现在,我遇到了这个错误,由于我是这项技术的新手,所以我无法解决它。
composer global require "laravel/installer"
Changed current directory to /home/indous-ubuntu/.composer
Using version ^1.4 for laravel/installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^1.4 -> satisfiable by laravel/installer[v1.4.0, v1.4.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.1/cli/php.ini
- /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.1/cli/conf.d/10-opcache.ini
- /etc/php/7.1/cli/conf.d/10-pdo.ini
- /etc/php/7.1/cli/conf.d/15-xml.ini
- /etc/php/7.1/cli/conf.d/20-calendar.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
如果有人知道是什么问题,请帮助我!
提前致谢!
编辑composer.json文件并替换为
"require": {
"laravel/framework": "4.2.*",
"laracasts/commander": "~1.0",
"laracasts/validation": "~1.0",
"laracasts/presenter": "0.1.*"
},
"require-dev": {
"way/generators": "~2.0"
},
此代码的参考以及更多详细信息
启用您的php ext-zip lib。 用安装
sudo apt-get install php7.0-zip
为php版本7 sudo apt-get install php7.0-zip
正如错误中已明确描述的那样,您缺少php-zip扩展名:
问题1-laravel / installer v1.4.1需要ext-zip *->系统中缺少所请求的PHP扩展zip。
尝试使用以下命令安装它(使用sudo
):
apt-get install php-zip
它将自动将其安装为PHP7,作为Ubuntu存储库中PHP的默认版本。
PS:如果您已经安装了php-zip,但是仍然无法正常工作,请将扩展名添加到/etc/php
php.ini
文件中,您就可以了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.