对未定义函数Curl_init()的Curl调用
我正在使用windows 10,我在php脚本cURL中使用它来获取一些资源:对未定义函数Curl_init()的Curl调用,curl,php-5.5,Curl,Php 5.5,我正在使用windows 10,我在php脚本cURL中使用它来获取一些资源: <?php // Get cURL resource $curl = curl_init(); // Set some options - we are passing in a useragent too here curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'http://
<?php
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://localhost/module/webservice.php/events/contentViewed/',
CURLOPT_USERAGENT => 'User Agent X'
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
print_r($resp);
?>
但我得到了这个错误:
致命错误:在第5行的C:\wamp\www\testTracker.php中调用未定义的函数curl\u init()
我检查了php.ini文件,启用了扩展名=php\u curl.dll
。此外,当我使用phpinfo()
检查cURL模块是否启用时,我只看到cURL=Sterling Hughes的作者
如何修复此错误?似乎没有安装cUrl。例如,如果您使用基于apt的linux发行版,请使用:
apt-get install php5-curl