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

1. 进到对应扩展目录

# cd /opt/modole/src/php-5.2.12/ext/curl

2. 调用phpize程序生成编译配置文件

# /opt/model/php/bin/phpize

3. 调用configure生成Makefile文件,然后调用make编译,make install安装

./configure -with-curl=/opt/modules/curl -with-php-config=/opt/modules/php/bin/php-config

报错:

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

解决:好像是丢包了,yum install curl curl-devel

重新编译

出现:

checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h

好像成功了?

make make install

[root@localhost curl]# make install
Installing shared extensions: /opt/modules/php/lib/php/extensions/no-debug-non-zts-20131226/

安装成功

4.修改php配置文件

查看 curl.so文件是否安装到这个目录下
#ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
修改php扩展库目录
#vi /usr/local/php/lib/php.ini
extension_dir = “/opt/modules/php/lib/php/extensions/no-debug-non-zts-20131226/”;

#vim /usr/local/php/lib/php.ini

extension=curl.so

检测是否安装成功,输入:/usr/local/php/bin/php -m

如果看到有curl项表示成功。

例如:

[root@localhost no-debug-non-zts-20131226]# /opt/modules/php/bin/php -m
[PHP Modules]
Core
ctype
curl
date
dom
ereg
fileinfo
filter
hash
iconv
json
libxml
mbstring
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter

php 未配置curl的更多相关文章

  1. 允许asp.net MVC报 错说明: 访问服务此请求所需的资源时出错。服务器可能未配置为访问所请求的 URL。错误消息 401.2。: 未经授权

    运行mvc3程序报以下错误 详细报错如下: “/”应用程序中的服务器错误. 访问被拒绝. 说明: 访问服务此请求所需的资源时出错.服务器可能未配置为访问所请求的 URL. 错误消息 401.2.: 未 ...

  2. 微信小程序问题2:未配置

    app.json 中未配置当前页面 pages/swipertest/swipertest 请检查后重试.console.error(`PAGE DEFINE ERRORapp.json 中未配置,当 ...

  3. Android Studio如何配置CURL指令一键打包apk上传至蒲公英

    Android Studio如何配置CURL指令一键打包apk上传至蒲公英 第一步:在所需要打包的模块build.gradle文件中加入如下代码: android{ buildTypes { //配置 ...

  4. 配置闪回恢复区开启归档,未配置清理归档脚本,数据库hang住

    问题现象,测试环境执行SQL hang住 enmo:/home/oracle/worksh dg.sh SQL*Plus: Release Production on Mon May :: Copyr ...

  5. k8s endpoints k8s未配置选择器的service

    service 其实是一个TCP/UDP 代理 不仅可以代理Pod也可以代理其他的非Pod资源,例如外网的数据库,或者其他的资源 创建未配置选择器的service, service 的对外端口是500 ...

  6. Linux系统安装配置curl

    1.获得安装包,从网上直接下载或者其他途径,这里直接wget wget http://curl.haxx.se/download/curl-7.20.0.tar.gz 2.解压到当前目录(或者 htt ...

  7. SQL Sever——无法连接到(local)。“未配置远程连接”和“请求失败或服务未及时响应”

       攻克了上篇博客提到的"远程过程调用失败(0x800706be)"的问题. 新的问题接踵而至. . . 一.       watermark/2/text/aHR0cDovL2 ...

  8. 解决GitHub未配置SSH key提示错误信息

    git push -u origin master Permission denied (publickey). fatal: Could not read from remote repositor ...

  9. HDFS 2.7.4中hdfs-site.xml参数未配置引发的一些异常

    生产上部署了HDFS 2.7.4,最近遇到了一些异常,记录下来备忘: 一.dfs.datanode.directoryscan.throttle.limit.ms.per.sec DataNode运行 ...

随机推荐

  1. js中正则表达式 书写方法

    function test(){    var text="index.aspx?test=1&ww=2&www=3";            var   re = ...

  2. window2012 64bit 安装sqlserver2012 64bit调用excel的驱动安装

    如果电脑已经安装了32bit的office那么可以使用 管理员权限打开cmd,然会执行以下命令 AccessDatabaseEngine_X64.exe /passive

  3. 设置pictureBox的边框颜色

    private void pictureBox2_Paint(object sender, PaintEventArgs e) { PictureBox p = (PictureBox)sender; ...

  4. Visual Studio原生开发的10个调试技巧(二)

    来源:oschina 发布时间:2013-08-10 阅读次数:397 51   我以前关于Visual Studio调试技巧的文章引起了大家很大的兴趣,以至于我决定分享更多调试的知识.以下的列表中你 ...

  5. Tiny语法分析器(递归下降分析法实现)

    递归规约规则是这样的 program→stmt-sequence stmt-sequence→stmt-sequence;statement|statement statement→if-stmt|r ...

  6. MyBatis核心配置文件模版

      <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLI ...

  7. linq分页扩展(转)

    原文地址:http://www.cnblogs.com/RainbowInTheSky/p/4590508.html public static List<T> ToPagedList&l ...

  8. jquery表单验证使用插件formValidator

    JQuery表单验证使用插件formValidator 作者: 字体:[增加 减小] 类型:转载 时间:2012-11-10我要评论 jquery表单验证使用插件formValidator,可供有需求 ...

  9. jQuery选择器介绍:基本选择器、层次选择器、过滤选择器、表单选择器

    选择器是jQuery的根基,在jQuery中,对事件处理.遍历DOM和Ajax操作都依赖于选择器.因此,如果能熟练的使用选择器,不仅能简化代码,而且可以达到事半功倍的效果.jQuery选择器完全继承了 ...

  10. 布隆过滤器(Bloom Filter)详解——基于多hash的概率查找思想

    转自:http://www.cnblogs.com/haippy/archive/2012/07/13/2590351.html   布隆过滤器[1](Bloom Filter)是由布隆(Burton ...