Linux下PHP安装curl扩展支持https
来源:互联网 发布:看书哪个软件好 编辑:程序博客网 时间:2024/06/06 12:58
编译安装curl,重新编译php,使php的curl模块支持https。
具体步骤:
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编译参数
/usr/local/php/bin/php -i | grep configure #查看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、重启apache使设置生效
service httpd restart #重启
故障解决!
5、测试
以下代码,保存为phpinfo.php
<?php
phpinfo();
?>
上传到网站目录,查找curl,如下图所示,说明安装成功!
- Linux下PHP安装curl扩展支持https
- linux下php扩展curl的安装
- Linux 下 PHP 扩展 cURL 编译安装
- linux下php扩展curl的安装
- linux下php扩展curl的安装
- linux 下扩展php curl
- Linux/Unix下 PHP 扩展 cURL 编译安装和配置
- 在Linux下安装PHP的curl扩展
- Linux/Unix下 PHP 扩展 cURL 编译安装和配置
- php---解决linux 下 php 扩展curl
- Centos5 下 安装php的 curl 扩展
- ubuntu下php安装curl扩展库
- CentOs下安装PHP扩展curl
- ubuntu下安装php扩展curl
- centos 下安装php扩展curl
- Linux下 添加PHP扩展模块 curl
- linux php扩展curl的安装
- Linux环境下让PHP支持curl
- 关于workerman在Thinkphp5的应用
- 仿京东下拉刷新动画的源码查看——自定义控件学习(一)
- 安卓长安保存图片三种方案的对比
- Solr-6.5.1之Solrj的使用
- poj-1836-士兵出列问题-双向LIS
- Linux下PHP安装curl扩展支持https
- 【并查集】poj 1611 The Suspects
- 堆排序
- 30分钟掌握ES6/ES2015核心内容
- 快速幂算法和大整数求模
- iOS UIWindow
- Frequently Used --- 连载
- redis主从配置
- bootstrap日期控件