2

I am trying to run composer install for a laravel project. The error is as below:

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].

I looked into that, it seems that PHP in my Mac doesn't have openSSL. But when I run

php -m

There is openssl module in the list.

Hence, I don't understand what the problem is.

Here is my composer.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"
}

}

PS: I just got a brand new Mac pro, haven't got time to install MAMP and Xcode, so I guess the php I used is internally built

Matilda Yi Pan
  • 658
  • 2
  • 8
  • 26

2 Answers2

2

Solved:

Install openSSL, curl, homebrew and php 5.6+ will resolve the problem.

Mac terminal commands:

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

composer require tymon/jwt-auth:0.5.*

Lee Han Kyeol
  • 2,371
  • 2
  • 29
  • 44
1

After searching and trying for hours, I made my way to solve this problem. The issue is because my macbook is the new one, no configuration at all, all the settings are default, including the php which is built in PHP.

After install MAMP, link the built php to MAMP php, then the problem is solved.

I guess built in PHP only has some basic modules, so, it is not compatible as the PHP from MAMP.

Refer to this post about how to link to MAMP PHP.

Community
  • 1
  • 1
Matilda Yi Pan
  • 658
  • 2
  • 8
  • 26
  • This didn't work for me when trying to do composer update. I'd just upgraded to El Capitan and hit this issue. Went with Vagrant and Laravel Homestead - everything works as expected now – Cuespeak Jun 29 '16 at 16:45
  • I'm using Homestead but still came across this problem. Turns out the problem was that I was using composer on the *host* machine, not in Homestead... – damd Aug 23 '16 at 11:56