php源码安装curl扩展报错

源码目录: /php-src/ext/curl
直接phpize,再./configure编译会报一下错误:

configure: error: Could not find cURL
./configure: line 4179: curl-dir: No such file or directory
./configure: line 4179: curl-dir: No such file or directory

需要先安装类库:
# yum install libcurl-devel

再来编译安装curl扩展

/usr/local/php/bin/phpize (使用phpize)

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

make

make install

php.ini中添加extension=curl

php -m 查看php扩展

安装成功!

posted @ 2021-08-17 23:59  洪先森  阅读(148)  评论(0编辑  收藏  举报