今天正好要用到PHP的curl功能,发现服务器上的PHP并没有配置curl,进而查询PHP官方文档,得知编译PHP时需要带上 –with-curl参数,才能把curl模块编译进去。我现在PHP已经编译安装进服务器了,不想再重新编译了,于是参考下面有网友评论的办法,单独编译curl模块,然后make install

首先需要下载官方的PHP源代码,然后定位到扩展目录下的curl,旧版本的PHP扩展目录可能是extensions,新版应该是ext。

cd /tmp
wget http://cn.php.net/get/php-5.3.10.tar.bz2/from/cn2.php.net/mirror
mv mirror php-5.3.10.tar.bz2
tar vxf php-5.3.10.tar.bz2
cd php-5.3.10/ext/curl
phpize
./configure
make install

上面的步骤做完后,再到php.ini添加extension = curl.so,可是我在做到./configure出现下面的错误提示:

configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/

基本上确定是丢失了什么包所致,上网搜索得到需要事先安装的依赖包。

# RetHat CentOS or Fedora 使用下面安装命令
yum install curl curl-devel
# Debian or Ubuntu使用下面的安装命令
apt-get install curl
apt-get install libcurl4-gnutls-dev

不过在搜索的过程中我发现了更方便的办法,在Debian环境下由于我的PHP是通过apt-get获取的,那么同样的curl也可以通过apt-get命令获取:

apt-get install curl
apt-get install php5-curl

呵呵,看来这样方便省事多了,于是就这样安装了,之前的办法就不考虑那,简单最好:-)

最后不要忘记使用invoke-rc.d php-cgi restart重启PHP CGI。

解决PHP编译cURL的reinstall the libcurl问题的更多相关文章

  1. configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/

    编译php出现错误: configure: error: Please reinstall the libcurl distribution - easy.h should be in <cur ...

  2. error: Please reinstall the libcurl distribution - easy.h should be in &lt;curl-dir&gt;/include/curl/

    运行php-5.3.10 --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --e ...

  3. 转 解决configure: error: Please reinstall the libcurl distribution

    今天配置一台server的php支持curl的时候, 出现如下报错 checking for cURL in default path... not foundconfigure: error: Pl ...

  4. c++ 编译 curl 报错 数组‘__curl_rule_01__’的大小为负 解决方法

    背景:在原有的项目GCC编译环境下(arm-linux 32位),增加x86-linux 64位的编译环境,编译curl库的时候发生错误. 其他:编译服务器为64位Centos 编译错误提示 /inc ...

  5. 学了C语言,如何利用CURL写一个下载程序?—用nmake编译CURL并安装

    在这一系列的前一篇文章学了C语言,如何为下载狂人写一个磁盘剩余容量监控程序?中,我们为下载狂人写了一个程序来监视磁盘的剩余容量,防止下载的东西撑爆了硬盘.可是,这两天,他又抱怨他的下载程序不好用,让我 ...

  6. configure: error: Please reinstall the libcurl distribution

    configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/ 基本上 ...

  7. vs2010编译curl为static库及测试

    1,编译curl为static库 用vs2010打开: curl-7.32.0\vs\vc6\vc6curl.dsw 选择LIB Release生成libcurl静态库: curl-7.32.0\vs ...

  8. 转 php安装错误configure: error: Please reinstall the libcurl distribu

    今天配置一台server的php支持curl的时候, 出现如下报错 checking for cURL in default path... not foundconfigure: error: Pl ...

  9. 记一次在mac上源码编译curl,使其支持NSS的过程

    一.背景 在一次学习https原理的过程中,希望客户端指定特定的cipher suites来抓包分析SSL/TLS的握手过程,就想到了使用curl工具,而不是使用浏览器. 接下来使用man curl找 ...

随机推荐

  1. java单例支持高并发

    单例对象(Singleton)是一种常用的设计模式.在Java应用中,单例对象能保证在一个JVM中,该对象只有一个实例存在.这样的模式有几个好处: 1.某些类创建比较频繁,对于一些大型的对象,这是一笔 ...

  2. Android 获取 json

    Android  获取 json MainActivity.java package com.example.jsontest; import java.io.IOException; import ...

  3. 学习Microsoft SQL Server 2008技术内幕:T-SQL语法基础

    第 2 章: 单表查询 use TSQLFundamentals2008; select * from Sales.orders; select empid, year(orderdate) as o ...

  4. Ubuntu 14 中 VirtualBox发生错误Kernel driver not installed (rc=-1908)

    宿主系统是Ubuntu 14,在VirtualBox中安装 CentOS 6.5 时,提示如下错误: Kernel driver not installed (rc=-1908) 网友提供的解决方案: ...

  5. REST和SOAP区别

     转载于: http://blog.csdn.net/idafish/article/details/6308916 REST似乎在一夜间兴起了,这可能引起一些争议,反对者可以说REST是WEB诞生之 ...

  6. jquery的confirm插件介绍

    参考:1.http://craftpip.github.io/jquery-confirm/ 2.http://www.bootcdn.cn/jquery-confirm/readme/    3.h ...

  7. PhantomJS用法示例

    收录待用,修改转载已取得腾讯云授权 前言 大家有没有发现之前我们写的爬虫都有一个共性,就是只能爬取单纯的html代码,如果页面是JS渲染的该怎么办呢?如果我们单纯去分析一个个后台的请求,手动去摸索JS ...

  8. shell报错:未预期的符号***附近有语法错误

    1.安装dos2unix(我的centos命令: yum install dos2unix)2.执行命令:dos2unix  文件名.sh 3.执行命令:bash  -n  文件名.sh (检查语法错 ...

  9. PuTTY连接Linuxserver常常断线解决方式

    PuTTY在远程连接server之后.常常会断线提示"Software caused connection abort",并且常常在非常短的时间内就失去连接. 解决方式例如以下: ...

  10. 使用 Apple Configurator 2 获取ipa文件

    如今很多人想要获取到App Store上的包却苦于无奈,先在要把App Store上的包载下来获取ipa,最直接的就是从手机设备上导出了,但是手机必须要9.0以下才可以导出,鄙人手中正好有公司的测试机 ...