• 解决PHP编译cURL的reinstall the libcurl问题


    今天正好要用到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出现下面的错误提示:

    PHP curl 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。

  • 相关阅读:
    使用jackson美化输出json/xml
    mybatis不报错,但是查询结果为0
    @Valid基于hibernate
    spring 整合 mybatis (不含物理分页)
    mybatis insert 自动生成key
    mybatis 配置延迟加载 和 缓存
    mybaits foreach
    2015-08-13T17:39:15
    Introduction
    mybatis 存储过程调用
  • 原文地址:https://www.cnblogs.com/xiaoleiel/p/8334319.html
Copyright © 2020-2023  润新知