Home > php教程 > php手册 > body text

Linux系统安装php扩展cURL

WBOY
Release: 2016-06-06 19:55:39
Original
963 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 Linux 作为一款成熟而稳定的操作系统,其具备很多的优点。于是大部分人学习Linux操作系统,本文为你介绍Linux下php扩展cURL的安装方法,希望你 能学会Linux下php扩展cURL的安装的知识。 方法一 安装c

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  Linux 作为一款成熟而稳定的操作系统,其具备很多的优点。于是大部分人学习Linux操作系统,本文为你介绍Linux下php扩展cURL的安装方法,希望你 能学会Linux下php扩展cURL的安装的知识。

  方法一

  安装cURL

  # wget  http://curl.haxx.se/download/curl-7.17.1.tar.gz  [url=http://curl.haxx.se/download/curl-7.15.0.tar.gz][/url]  # 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就好了

  以上两种就是Linux下php扩展cURL的安装方法。

  sh# wget http://curl.haxx.se/download/curl-7.18.2.tar.gz

  sh# tar -zxvf curl-7*.gz

  sh# cd curl*

  sh# ./configure --prefix=/usr/local/curl

  sh# make

  sh# make install sh# cd /usr/local/src/php-5.2.1 (这是源码安装php时的源码目录)

  sh# cd ./ext/curl

  sh# phpize

  sh# ./configure --with-curl=/usr/local/curl

  运行./configure时,如果提示

  configure: error: Cannot find php-config. Please use --with-php-config=PATH

  请使用:

  ./configure --with-php-config=/php-install-path/bin/php-config #而不是使用php.ini

  sh# make

  sh# cp modules/curl.so /usr/local/lib/php/extensions (复制modules/curl.so到php的扩展目录下)

  (修改php.ini文件,加入: extension=curl.so)

  sh# apachectl -k restart (重启apache,应该php就有curl扩展了)   php.ini修改方法,根据你的实际curl.so文件位置来写,比较我编译后的位置: /usr/local/php/lib/php/extensions/no-debug-zts-20060613/ 那么php.ini就加上 extension="/usr/local/php/lib/php/extensions/no-debug-zts-20060613/curl.so"

Linux系统安装php扩展cURL

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!