phpStudy集成環境下 安裝composer

報錯提示:php

  1. The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: 因爲鏈接方在一段時間後沒有正確答覆或鏈接的主機沒有反應,鏈接嘗試失敗。  
  2. The "https://getcomposer.org/download/1.2.0/composer.phar.sig" file could not be downloaded: SSL: crypto enabling timeout  
  3. Failed to enable crypto  
  4. failed to open stream: operation failed

 

一、安裝composer須要開啓openssl拓展 而phpstudy默認是關閉的html

二、將PHP/ext文件夾下的: php_openssl.dll, ssleay32.dll, libeay32.dll 3個文件拷貝到WINDOWS\system32 文件夾下。瀏覽器

三、openssl須要CA證書 phpstudy也是沒有的 CA證書下載地址:http://curl.haxx.se/docs/caextract.html 選中以後單擊右鍵選擇另存爲 下載成功以後放到tmp文件夾下面composer

四、而後修改php.ini文件curl

openssl.cafile = "D:\phpStudy\tmp\cacert.pem"

 五、重啓phpStudy就能夠了url

 

報錯提示:spa

failed to open stream: HTTP request failed! htm

 

一、檢查一下php的curl拓展是否開啓blog

二、檢查這兩個配置是否開啓。
ssl

 

    allow_url_fopen = On  
    user_agent="PHP"  

 

也能夠這樣配置 user_agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)")

 

模擬瀏覽器訪問也是一個不錯的選擇

三、開啓以後重啓重啓phpStudy就能夠了

相關文章
相關標籤/搜索