centeros php安装curl

进入php安装目录cd ext/curl使用命令
/usr/local/php/bin/phpize 一定要在curl文件夹下执行phpize命令,否则会报错:Cannot find config.m4
执行完成后配置:

./configure --with-php-config=/usr/local/php/bin/php-config --with-curl=/usr/local/curl/  

这里如果报错

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

如果出现这个错误执行安装:

yum install m4
yum install autoconf

安装完成后再次配置,没有问题后

make #编译
找到目录/usr/local/php/lib/php/extensions/下的curl.os
配置PHP.ini加入extension="curl.so"

重启php-fpm

猜你喜欢

转载自blog.csdn.net/sunguoqiang1213/article/details/79045291