在使用
PHP 5.6.3在Ubuntu 14.04上克隆存储库后,我无法运行PHP composer.phar selfupdate,也无法运行PHP composer.phar update.我收到这条消息:
[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
我认为问题应该是我本地的证书,但我无法想象如何解决它.
这是composer.json:
{ "name": "zendframework/skeleton-application","description": "Skeleton Application for ZF2","license": "BSD-3-Clause","keywords": [ "framework","zf2" ],"homepage": "http://framework.zend.com/","require": { "PHP": ">=5.3.3","zendframework/zendframework": "2.3.*","evandotpro/edp-module-layouts": "1.*","tecnick.com/tcpdf": "~6.0@stable","PHPoffice/PHPexcel": "1.7.*" },"require-dev": { "PHPunit/PHPunit": "4.1.*","PHPunit/PHPunit-selenium": ">=1.2" },"autoload": { "psr-0": {"BOZA\\": "vendor/BOZA/"},"classmap": ["vendor/tecnick.com/tcpdf"] }
造成这种情况的一个原因可能是PHP丢失或找不到证书.
是否安装了ca-certificates软件包?
如果不是:apt-get install ca-certificates或者只是从这里下载证书包:
> http://curl.haxx.se/ca/cacert.pem
> https://github.com/bagder/ca-bundle/blob/master/ca-bundle.crt
然后检查并编辑PHP.ini,以便这些证书用于PHP建立的SSL连接.
curl.cainfo=/path/to/ssl/certs/ca-bundle.crt openssl.cafile=/path/to/ssl/certs/ca-bundle.crt