php安装curl扩展

原文链接:​​​​​​php 编译安装curl 扩展_遗1的博客-CSDN博客_php安装curl扩展

1、下载curl

cd /usr/local/src  #进入安装包存放目录

wget http://curl.haxx.se/download/curl-7.44.0.tar.gz  #下载

2、安装curl

cd /usr/local/src

tar zxvf curl-7.44.0.tar.gz  #解压

cd curl-7.44.0  #进入包安装目录

./configure --prefix=/usr/local/curl --with-gssapi --enable-tls-srp --with-libmetalink  #配置

make  #编译

make install  #安装

3、重新编译php

查找系统之前的php编译参数

   #查看php编译参数

如下:

'./configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql-sock=/tmp/mysql.sock' '--with-pdo-mysql=/usr/local/mysql' '--with-gd' '--with-png-dir=/usr/local/libpng' '--with-jpeg-dir=/usr/local/jpeg' '--with-freetype-dir=/usr/local/freetype' '--with-xpm-dir=/usr/' '--with-zlib-dir=/usr/local/zlib' '--with-t1lib=/usr/local/t1lib' '--with-iconv' '--enable-libxml' '--enable-xml' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--enable-mbregex' '--enable-mbstring' '--enable-ftp' '--enable-gd-native-ttf' '--with-openssl' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--without-pear' '--with-gettext' '--enable-session' '--with-mcrypt' '--with-curl ' '--enable-ctype'

对参数进行修改:

如下

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl=/usr/local/curl --enable-ctype

备注:修改部分

系统运维 www.osyunwei.com 温馨提醒:系统运维原创内容©版权所有,转载请注明出处及原文链接

取消原来的--with-curl

替换为:--with-curl=/usr/local/curl

取消参数两边的单引号

其它不变

cd /usr/local/src/php #进入php安装包目录(注意php版本要和之前一样)

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl=/usr/local/curl --enable-ctype   #配置

make #编译

make install #安装

4、php.ini文件中去掉curl扩展的注释

5、重启apache使设置生效

service httpd restart #重启

故障解决!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值