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

标签 php laravel ubuntu

我有 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/

相关文章:

php - Magento 获取购物车中的所有产品而不是最新的

Phpunit 测试 Laravel Controller

php - Laravel 别名找不到类

javascript - 在 laravel 中使用 auth()->login() 方法时如何防止重定向?

ubuntu - 使用 ImageMagick 从文本生成图像?

php - 嵌入式 PHP 防止滚动

php - 在用户单击时运行 PHP 代码并传递变量

php - 按年、月对事件进行分组,然后列出每个事件 - PHP 和 MySQL

运行多个进程时 MySQL 连接被拒绝

python-3.x - 使用 python 3.x 将 tkinter 导入到 pycharm 项目中时,tkinter 未被识别为库¿为什么?