php 编译安装curl 扩展

php 编译安装curl 扩展问题:线上运行的lamp服务器,默认yum安装的curl模块只支持http,不支持https。解决方法:编译安装curl,重新编译php,使php的curl模块支持https。具体步骤:1、下载curlcd/usr/local/src#进入安装包存放目录wgethttp://curl.haxx.se/download/curl-7.44.0.tar.gz#下载2、安装curlcd/usr/local/srctarzxvfcurl-7.44.0.tar..

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

转载地址:https://www.osyunwei.com/archives/9254.html

问题:

线上运行的lamp服务器,默认yum安装的curl模块只支持http,不支持https。

解决方法:

编译安装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编译参数

   #查看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,如下图所示,说明安装成功!

php 编译安装curl 扩展

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/194132.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • Java注解@NotNull

    Java注解@NotNull@Null被注释的元素必须为null@NotNull被注释的元素不能为null@AssertTrue被注释的元素必须为true@AssertFalse被注释的元素必须为false@Min(value)被注释的元素必须是一个数字,其值必须大于等于指定的最小值@Max(value)被注释的元素必须是一个数字,其值必须小于等于指定的最大值@DecimalMin(val…

  • xsrf form html,python – tornado开启了xsrf_cookies,在ckeditor中上传文件如何传入xsrf_form_html()?…

    xsrf form html,python – tornado开启了xsrf_cookies,在ckeditor中上传文件如何传入xsrf_form_html()?…tornado在setting中设置了”xsrf_cookies”:True,则需要在表单中添加{%modulexsrf_form_html()%}。但ckeditor如何传xsrf_cookies这个值,每次上传图片都显示’_xsrf’argumentmissingfromPOST。如果把”xsrf_cookies”设置为False则上传成功。下面是上传的代码classcku…

  • windows无exe

    windows无exewindows无exe加载脚本方式恶意脚本加载powershellmshta.exeCScript.exe&WScript.exeWindows原生工具加载regsvr32.exedllsctcertutil.exewinrm.vbsmsiexec.exewmic.exepubprn.vbs参考加载脚本方式利用Windows自带的解析器:PowerShell、VBScript、批处理文件和JavaScript,对应的应用程序分别为powershell.exe、cscript.exe、cmd.ex

  • 剑指Offer面试题:7.斐波那契数列

    一题目:斐波那契数列二效率很低的解法很多C/C++/C#/Java语言教科书在讲述递归函数的时候,大多都会用Fibonacci作为例子,因此我们会对这种解法烂熟于心上述递归的解法有很严重的效

    2021年12月19日
  • JavaScript实现进制转换

    JavaScript实现进制转换

  • 一阶惯性环节的性能分析——自动控制原理基础补充(二)

    一阶惯性环节的性能分析——自动控制原理基础补充(二)以前读书的时候学习自动控制原理,就是为了考试,各种相频幅频特性题咣咣做,一点都不含糊,但是实际代表什么意义一点都不知道。现在真是发现,这个东西有用得一批。这篇文章从一阶惯性环节为切入点,对自动控制原理进行一个简单的复习。还蛮喜欢博客里面写东西的,按照自己思路,按照逻辑一点一点往下,不像发文章八股文一样。1一阶惯性环节的bode图对于这个非常常见的一阶惯性系统而言,其关键指标就是截止频率。截止频率的定义:从频域响应的角度讲,当保持输入信号的幅度不变,改变频率使输出信号降至最大值的0.707倍

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号