Cannot establish SSL connection with Composer with PHP 5.6.3

前端 未结 3 1468
梦谈多话
梦谈多话 2021-01-12 05:54

After cloning a repository on Ubuntu 14.04 with PHP 5.6.3 I am unable to run php composer.phar selfupdate neither php composer.phar update. I get t

相关标签:
3条回答
  • 2021-01-12 06:24

    One cause of this might be that certs are missing or not found by PHP.

    Is the ca-certificates package installed?

    If not: apt-get install ca-certificates or simply download the certificate bundle from here:

    • http://curl.haxx.se/ca/cacert.pem
    • https://github.com/bagder/ca-bundle/blob/master/ca-bundle.crt

    Then check and edit your php.ini, so that these certs are used for the SSL connection made by PHP.

    curl.cainfo=/path/to/ssl/certs/ca-bundle.crt
    openssl.cafile=/path/to/ssl/certs/ca-bundle.crt
    
    0 讨论(0)
  • 2021-01-12 06:29

    You can downlode this pem file:

    http://curl.haxx.se/ca/cacert.pem

    then locate it in php.ini , eg:

    openssl.cafile=/usr/local/etc/openssl/cacert.pem
    

    ref: http://akrabat.com/ssl-certificate-verification-on-php-5-6/

    0 讨论(0)
  • 2021-01-12 06:33

    For a similar ssl connection error

    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate

    Here is how I got it resolved.

    0 讨论(0)
提交回复
热议问题