小灰博客--小灰IT技术博客 | sky00.com

PHP下如何开启curl

curl 是使用URL语法的传送文件工具,支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP 上传,kerberos、基于HTT格式的上传、代理、cookie、用户+口令证明、文件传送恢复、http代理通道和大量其他有用的技巧。详见参考手册
原来php默认并不进行此项功能的扩展,但还是有的,只是没有让它生效罢了。

windows下开启方法:

1、拷贝PHP目录中的libeay32.dll, ssleay32.dll, php_curl.dll文件到 system32 目录。没有可以去下载!
2、修改php.ini:配置好 extension_dir ,去掉 extension = php_curl.dll 前面的分号。
3、重起apache或者IIS。

linux下开启方法:

方法一
安装cURL
# wget http://curl.haxx.se/download/curl-7.17.1.tar.gz
# tar -zxf curl-7.17.1.tar.gz
# ./configure –prefix=/usr/local/curl
# make; make install

安装php

只要打开开关 –with-curl=/usr/local/curl

就可以了。

这个扩展库还是非常棒,是fsockopen等等相关的有效的替代品。

方法二 进入安装 原php 的源码目录,
cd ext
cd curl
phpize
./configure –with-curl =DIR
make
就会在PHPDIR/ext/curl /moudles/下生成curl .so的文件。

复制curl .so文件到extensions的配置目录,修改php .ini就好了

测试是否成功,执行

1
<!--?php phpinfo() ?-->

成功则有如下显示
20111023163508


如果该文章帮到了您,不妨帮忙分享支持下博主!
同时也欢迎各位技术爱好者加入IT技术群(点击即可):70035098 互相交流学习!

分享该文章到:


发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

分类

最新评论

  • + 1.195608 BTC.NEXT - https://graph.org/Message--17856-03-25?hs=9e710a17c6f1893b8975843ad65a53ec&:102182
  • + 1.498411 BTC.NEXT - https://graph.org/Message--17856-03-25?hs=aac6bac50a00897dcb59231afcd85b90&:ca7l9u
  • + 1.594516 BTC.GET - https://graph.org/Message--17856-03-25?hs=20bcd57ec809274e19061c909e168662&:xfnxxa
  • Notification- Process 1.846583 BTC. Verify =>> https://graph.org/Message--17856-03-25?hs=46cca2220f62b645c465c3659609f169&:o4qdng
  • + 1.628365 BTC.NEXT - https://graph.org/Message--17856-03-25?hs=d2e9f25426f06f324d26af9866fa1537&:oh0f52
  • + 1.106535 BTC.GET - https://graph.org/Message--17856-03-25?hs=98190feaf2cf13b298012d5af2183ac8&:lzc0m1
  • We send a transfer from unknown user. Next > https://graph.org/GET-BITCOIN-TRANSFER-02-23-2?hs=9e710a17c6f1893b8975843ad65a53ec&:fqrvth
  • Ticket: SENDING 0.75905835 BTC. Next => https://graph.org/GET-BITCOIN-TRANSFER-02-23-2?hs=189b84788c5e6405c53f7dd1193b9874&:h8yo8m
  • + 0.75386069 BTC.NEXT - https://graph.org/GET-BITCOIN-TRANSFER-02-23-2?hs=d9564a149cf7ebbc725fcfce1bd3d512&:bc1353
  • Sending a transfer from unknown user. Take >> https://graph.org/GET-BITCOIN-TRANSFER-02-23-2?hs=b0daecdb412780460f6d70d2ebe7020c&:aau2lw
  • You have received a message(-s) № 221889. Open >> https://telegra.ph/Binance-Support-02-18?hs=bd8a1e7af9a0091b9e1cfeb86b9552cb&:kqpbhi
  • Notification; Operation №IV67. Go to withdrawal => https://telegra.ph/Binance-Support-02-18?hs=08b576daf9c0848743e65271d9d88559&:qwsyif
  • + 0.75961990 BTC.NEXT - https://telegra.ph/Binance-Support-02-18?hs=20bcd57ec809274e19061c909e168662&:p4uthc
  • We send a transaction from our company. Withdrаw =>> https://telegra.ph/Binance-Support-02-18?hs=3f08de96112b4bab631df916e9c95f9e&:5k6fth
  • Notification: Transaction №TN98. ASSURE =>> https://telegra.ph/Binance-Support-02-18?hs=8b618b6f3e2558ea545b01f25c66ea45&:5jevqs
  • Sending a transaction from unknown user. Continue > https://telegra.ph/Binance-Support-02-18?hs=1d869d5a917cbf0e695c5782af266195&:nnl072
  • + 0.75788585 BTC.GET - https://telegra.ph/Get-BTC-right-now-01-22?hs=9e710a17c6f1893b8975843ad65a53ec&:80ymq4
  • You have a email № 897905. Read >>> https://telegra.ph/Get-BTC-right-now-01-22?hs=7fc809c4247ff3bb3e2b81fd7b90d625&:whaht3
  • You have received a message # 76978. Go >>> https://telegra.ph/Get-BTC-right-now-01-22?hs=3da051666d269a0bc63a99730221a24b&:pt6kzb
  • You got a transfer from user. Get => https://telegra.ph/Get-BTC-right-now-01-22?hs=3f08de96112b4bab631df916e9c95f9e&:zi27wf