Laravel作曲家安装无法解决Tymon/JWT-AUTH的可安装包



我正在尝试为拉拉维尔项目运行作曲家安装。错误如下:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for namshi/jose 5.0.2 -> satisfiable by namshi/jose[5.0.2].
    - namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
  Problem 2
    - namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
    - tymon/jwt-auth 0.5.9 requires namshi/jose 5.0.* -> satisfiable by namshi/jose[5.0.2].
    - Installation request for tymon/jwt-auth 0.5.9 -> satisfiable by tymon/jwt-auth[0.5.9].

我调查了一下,似乎我的Mac中的PHP没有openSSL。但是当我跑步时

php -m

列表中有openssl模块。

因此,我不明白问题是什么。

这是我的作曲家.json

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "tymon/jwt-auth": "0.5.*",
    "barryvdh/laravel-ide-helper": "^2.1",
    "fzaninotto/faker": "~1.4",
    "zizaco/entrust": "~2.0"
},
"require-dev": {
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database",
        "app/Services"
    ],
    "psr-4": {
        "App\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r "copy('.env.example', '.env');""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
}

}

附注:我刚刚买了一个全新的Mac pro,没有时间安装MAMP和Xcode,所以我想我使用的php是内部构建

已解决:

安装 openSSL、curl、自制软件和 php 5.6+ 将解决此问题。

Mac 终端命令:

brew install homebrew/php/php56 --with-homebrew-curl --with-openssl

composer require tymon/jwt-auth:0.5.*

经过几个小时的搜索和尝试,我开始解决这个问题。问题是因为我的Macbook是新的,根本没有配置,所有设置都是默认的,包括用PHP内置的php。

安装 MAMP

后,将构建的 php 链接到 MAMP php,问题就解决了。

我想内置的 PHP 只有一些基本模块,因此,它与 MAMP 的 PHP 不兼容。

请参阅这篇文章,了解如何链接到 MAMP PHP。

相关内容

  • 没有找到相关文章

最新更新