Cannot establish SSL connection with Composer with PHP 5.6.3

前端 未结 3 1469
梦谈多话
梦谈多话 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
    

提交回复
热议问题