问题描述
我想为一个laravel项目运行composer安装。
错误如下:
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].
我注意到,似乎PHP在我的Mac没有openSSL。
但是当我运行
I looked into that, it seems that PHP in my Mac doesn't have openSSL.But when I run
php -m
在列表中有openssl模块。
There is openssl module in the list.
因此,我不明白问题是什么。
Hence, I don't understand what the problem is.
以下是我的composer.json
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:
新的Mac pro,没有时间安装MAMP和Xcode,所以我想我使用的PHP是内部建立
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
推荐答案
搜索和尝试几个小时后,我的方式来解决这个问题。
问题是因为我的macbook是新的,没有配置,所有的设置都是默认的,包括php是PHP内置的。
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.
安装MAMP后,将构建的php链接到MAMP php,然后问题解决。
After install MAMP, link the built php to MAMP php, then the problem is solved.
我猜内置的PHP只有一些基本的模块,所以,它不兼容作为PHP从MAMP。
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.
这篇关于laravel作曲家安装无法解决的安装包tymon / jwt-auth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!