本文介绍了已启用php / curl,但仍然收到错误“调用未定义函数curl_init()”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 对不起,我意识到这是一个常见的问题,但我遵循所有的标准建议没有效果。 我试图使用由其他人提供的php库,它为curl提供包装函数。我已经取消注释extension = php_curl.dll在php.ini文件,保存它,并重新启动我的服务器(Wampserver)。我也在浏览器中做了一个phpinfo(),说curl是启用的,但是我继续得到上面提到的错误。 这里是代码片段,与违规行249 - 函数http($ target,$ ref,$ method,$ data_array,$ incl_head) {#初始化PHP / CURL句柄 $ ch = curl_init(); #如果出现$ pr if(is_array($ data_array)) {#将数据数组转换为查询字符串ie animal = dog& sport = baseball) foreach($ data_array as $ key => $ value) etc ... 我有三次检查所有上述,甚至重新启动我的电脑,并再次检查绝望 - curl扩展是绝对没有注释和phpinfo()肯定显示curl为启用。 / p> 希望有人知道发生了什么。 谢谢,保罗。 解决方案您需要在两个位置启用 php_curl.dll $ b 打开C:wamp\bin\php\php5.2.6\php.ini 查找; extension = php_curl.dll,并删除分号以取消注释行 对C:wamp\bin\apache\apache2.2.8\bin \php.ini Sorry, I realise this is an oft-asked question but I've followed all of the standard advice to no avail.I'm trying to use a php library written by somebody else which provides wrapper functions for curl. I have uncommented extension=php_curl.dll in the php.ini file, saved it and restarted my server (Wampserver). I have also done a phpinfo() in the browser which says that curl is enabled, however I continue to get the error mentioned above.Here is snippet of the code, with the offending line 249 -function http($target, $ref, $method, $data_array, $incl_head){# Initialize PHP/CURL handle$ch = curl_init(); <----# Prcess data, if presentedif(is_array($data_array)) { # Convert data array into a query string (ie animal=dog&sport=baseball) foreach ($data_array as $key => $value) etc...I have triple checked all of the above and even restarted my computer and checked again in desperation - the curl extension is definitely uncommented and phpinfo() definitely shows curl as being enabled.Hope someone might have an idea what's up?Thanks,Paul. 解决方案 You need to enable php_curl.dll in two locationsOpen C:wamp\bin\php\php5.2.6\php.iniFind ";extension=php_curl.dll" and remove the semicolon to uncommentthe lineDo the same for C:wamp\bin\apache\apache2.2.8\bin\php.ini 这篇关于已启用php / curl,但仍然收到错误“调用未定义函数curl_init()”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-28 14:26