2015-05-14 37 views
5

我剛安裝了apache,php和curl到我的電腦。但我認爲cURL和PHP5.6有什麼問題。其實我可以安裝作曲家忽略警告,但我不能使用作曲家。在ubuntu上安裝composer時遇到問題

我得到這個:

curl: (60) SSL certificate problem: unable to get local issuer certificate 

當我運行此:

curl -sS https://getcomposer.org/installer | php 

和平..

+0

我也有一個問題,今天與PHP 5.6有關SwiftMailer和SSL證書。我剛回到5.5。 – systemovich

+0

如何回滾到5.5? –

+0

我在Kububtu 14.04上。爲了得到PHP 5.6,我安裝了一個ppa,然後升級了所有東西。爲了回滾,我刪除了ppa,卸載了PHP,然後從官方存儲庫重新安裝了所有php組件(php5-fpm,php-xdebug,php5-common,php5-mysql,php5-mcrypt)以返回到5.5。 – systemovich

回答

2

嘗試更新您的本地證書:

sudo update-ca-certificates 

cd /etc/ssl/certs 
sudo wget http://curl.haxx.se/ca/cacert.pem 

然後用這個證書文件的命令:

curl -sS https://getcomposer.org/installer | php -- --cafile=/etc/ssl/certs/cacert.pem 

所有的一切:你拉新的證書,並使用該上的CLI捲曲命令。


下一步是讓cURL PHP擴展工作。

  • 調整php.ini
  • 使OpenSSL的擴展
  • 使捲曲擴展
  • curl.cainfo=/etc/ssl/certs/cacert.pem
  • openssl.cafile=/etc/ssl/certs/cacert.pem
+1

我已經試過這兩種,但沒有幫助。 –

+0

至少你已經更新了你的證書,現在試試'curl -sS https://getcomposer.org/installer | php - --cafile =/etc/ssl/certs/cacert.pem' –

+1

沒有任何變化.. –