gpt4 book ai didi

php - 在 ubuntu 中安装 laravel 时出现错误

转载 作者:太空宇宙 更新时间:2023-11-03 17:08:13 25 4
gpt4 key购买 nike

我有 PHP 版本:

php -v
PHP 7.1.9-1

Composer 版本:

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"
},

此代码的引用和更多详细信息 Reference

关于php - 在 ubuntu 中安装 laravel 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46520206/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com