How do I enable curl for php

只愿长相守 提交于 2019-12-18 05:03:13

问题


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

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:

回答1:


Check whether you have php5-curl installed

dpkg -l | grep 'php5-curl'

If isn't installed,

apt-get install php5-curl

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

php -i | grep extension_dir

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

If everything is correct, restart PHP-FPM

/etc/init.d/php5-fpm restart



回答2:


To enable curl uncomment

;extension=php_curl.dll
to
extension=php_curl.dll


来源:https://stackoverflow.com/questions/23233460/how-do-i-enable-curl-for-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!