首頁  >  文章  >  後端開發  >  php curl 不支援https怎麼辦

php curl 不支援https怎麼辦

藏色散人
藏色散人原創
2021-05-24 09:19:382680瀏覽

php curl不支援https的方法:1.重新編譯安裝新版本curl;2、重新編譯安裝php,然後查看phpinfo()頁面,搜尋curl,確定是否已經支援https協定即可。

php curl 不支援https怎麼辦

本文操作環境:Windows7系統、PHP7.1版,DELL G3電腦

解決php-curl不支援https問題

主要原因是因為先前安裝的curl 不支援https 協議,導致php-curl 也不支援https 協議

#/server/app/services/bin/curl -V查看curl 的版本號,和支援的協定

解決方法:

1> 重新編譯安裝新版本curl

#cd /server/install/
#tar -xvf curl-7.37.0.tar.gz 
#cd curl-7.37.0
#./configure --prefix=/server/app/services
#make && make install
#/server/app/services/bin/curl -V   (查看是否支持https)

2> 重新編譯安裝php ,具體參考文件中,php 的編譯部分

#cd /server/install/php-5.3.20
#make clean
#rm -f configure
#./buildconf --force
#./configure --prefix=/server/app/services/ --with-libxml-dir=/server/app/services/ --with-config-file-path=/server/app/services/ --enable-fastcgi --enable-force-cgi-redirect --with-curl=/server/app/services --enable-apc --enable-memcache --with-zlib-dir=/server/app/services/ --with-zlib --with-libmemcached-dir=/server/app/services/ --enable-memcached --enable-sockets --enable-fpm --enable-pdo  --enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-openssl --with-freetype=/usr/local/freetype/ --enable-ftp  --enable-gd-native-ttf --enable-gd-jis-conv
#make
#make install
#reboot

查看phpinfo() 頁面,搜尋curl ,確定是否已經支援https 協定

推薦學習:《PHP影片教學

以上是php curl 不支援https怎麼辦的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn