How to enable cURL in PHP / XAMPP

2019-01-01 03:45发布

How do I enable cURL in PHP?

​​

标签: php curl xampp
16条回答
公子世无双
2楼-- · 2019-01-01 03:56

Since you're using XAMPP, uncomment the line

;extension=php_curl.dll

in xampp\apache\bin\php.ini, and then restart the Apache service.

NB: In newer XAMPP versions, PHP has moved to root xampp folder xampp\php\php.ini.

查看更多
余欢
3楼-- · 2019-01-01 03:58

You can check phpinfo() (create a script containing and browse to it). This will tell you if you really do have it enabled. If not, read here.

It is not recommended for the faint-hearted Windows developer.

查看更多
泛滥B
4楼-- · 2019-01-01 04:00

For Ubuntu (and probably all Debian-Based) Linux Distributions:

sudo apt-get install php5-curl
sudo /etc/init.d/apache2 restart 

You might have seen PHP Fatal error: Call to undefined function curl_init() before.

查看更多
柔情千种
5楼-- · 2019-01-01 04:01

check if curl module is available

$ ls -la /etc/php5/mods-available/

enable the curl module

$ sudo php5enmod curl

source: http://baligena.com/installing-curl-ubuntu-server/

查看更多
琉璃瓶的回忆
6楼-- · 2019-01-01 04:04

On Debian with Apache 2:

apt-get install php5-curl
/etc/init.d/apache2 restart

(php4-curl if it's php4)

查看更多
登录 后发表回答