Rob*_*cha 1 ssl laravel composer-php
我正在使用OS X Yosemite
我在Composer中运行以下命令,因为Laravel无法始终正常下载和安装:
composer diagnose
结果:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking disk free space: OK
Checking composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: SSL ope
ration failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed
Failed to enable crypto
failed to open stream: operation failed
Run Code Online (Sandbox Code Playgroud)
我想关注的主线是:
SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题.我在网上尝试了几种解决方案,但都没有.我对使用命令行完全不熟悉.
使用以下命令下载和安装Laravel时:composer create-project laravel/laravel --prefer-dist我不能自己手动下载这些东西并将其放在正确的文件夹中以避免此SSL问题吗?
注意:我正在运行OS X Yosemite.我相信这也适用于小牛队.
在看了几个答案并将它们混合和匹配等之后.这是对我所做的一个粗略的解释.
locate cacert.pem
这将列出您的证书所在的所有位置.
我的结果:
/Applications/Adobe Dreamweaver CS6/Configuration/Certs/cacert.pem
/Applications/MAMP/Library/lib/python2.7/test/pycacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/_vendor/requests/cacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/pycacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_asyncio/pycacert.pem
/Users/robert/.composer/cacert.pem
/opt/vagrant/embedded/cacert.pem
/usr/ssl/certs/cacert.pem
Run Code Online (Sandbox Code Playgroud)
http://curl.haxx.se/docs/caextract.html
/usr/ssl/certs/并将下载的证书放在那里 /usr/ssl/certs/cacert.pem
我打开了我的php.ini文件并将此行放在文件的顶部:
openssl.cafile=/usr/ssl/certs/cacert.pem
重启apache(停止apache并重新启动)
一切都为我而努力.
现在我认为需要做的一件事就是你需要告诉命令行你指的是哪个PHP.我在XAMPP下运行PHP,而不是在我的OS X上运行.所以命令行会认为你指的是OS X上的本机PHP而不是XAMPP上运行的PHP.这需要改变我相信这是有效的.如果不是那么它应该是好的.
如上所述,这个解决方案对我有用.
| 归档时间: |
|
| 查看次数: |
19640 次 |
| 最近记录: |