如何为 php 启用 curl [英] How do I enable curl for php

查看:31
本文介绍了如何为 php 启用 curl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 DotDeb 存储库在 Debian Wheezy 上使用 NGINX 和 PHP-FPM.

I'm using NGINX with PHP-FPM on Debian Wheezy via DotDeb repo.

这是我的 php.ini 文件中唯一的 curl 引用,我不确定我需要做什么.任何帮助表示赞赏(它已经安装)

This is the only curl reference in my php.ini file and I'm not sure what I need to do. Any help is appreciated (it's already installed)

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =

; Local Variables:
; tab-width: 4
; End:

推荐答案

检查是否安装了php5-curl

dpkg -l | grep 'php5-curl'

如果没有安装,

apt-get install php5-curl

确保extension_dir中的路径存在,并且包含curl.so,如果没有,请修改为正确的路径.

Ensure the path in extension_dir exists, and contains curl.so, if not, change to the correct path.

php -i | grep extension_dir

确保 /etc/php5/mods-available/curl.ini 存在并加载 curl.so

Ensure the /etc/php5/mods-available/curl.ini exists and has the curl.so loaded

; configuration for php CURL module
; priority=20
extension=curl.so

如果一切正常,重启 PHP-FPM

If everything is correct, restart PHP-FPM

/etc/init.d/php5-fpm restart

这篇关于如何为 php 启用 curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆