linux+php安装curl

作者:忆茶篍

创新互联主要业务有网站营销策划、成都做网站、成都网站建设、微信公众号开发、微信小程序开发H5建站、程序开发等业务。一次合作终身朋友,是我们奉行的宗旨;我们不仅仅把客户当客户,还把客户视为我们的合作伙伴,在开展业务的过程中,公司还积累了丰富的行业经验、全网整合营销推广资源和合作伙伴关系资源,并逐渐建立起规范的客户服务和保障体系。 

linux + php 安装curl
进入安装原php的源码目录,

cd ext

cd curl

/usr/local/php5/bin/phpize  在源码目录里执行此行代码才会有用 此目录为php的安装目录

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

执行此行代码 可能会报错 

configure: error: Please reinstall the libcurl distribution 

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/



其实就是curl的dev包没有安装, 解决方案:
终端下

# yum -y install curl-devel

然后

make & make install

就会在

/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
下生成curl.so的文件。

修改php.ini就好了

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/curl.so

# /usr/local/apache2/bin/apachectl start

到此成功了,在phpinfo中可以看到CURL的项。


文章题目:linux+php安装curl
文章转载:http://pwwzsj.com/article/isgggg.html