windows 10_Windows下CURL扩展无效解决办法

更新时间:2020-10-04    来源:系统相关    手机版     字体:

【www.bbyears.com--系统相关】

1、在php.ini配置文件中启用 php_curll.dll 扩展
2、extension_dir = "E:/env/php-5.6.21/ext",写绝对路径
3、系统环境变量加入PHP环境根目录,path E:\env\php-5.6.21\;
4、查看版本兼容性

按上面办法开始之后我们测试一下curl函数

// create a new curl resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, “http://www.111cn.net/”);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// grab URL, and print
curl_exec($ch);
?>

发现可以返回正常的值也不会有错误提示curl_init()函数未定义的错误了。

本文来源:http://www.bbyears.com/aspjiaocheng/102588.html

热门标签

更多>>

本类排行