您好,欢迎访问一九零五行业门户网

[ubuntu]

$ch=cur_init();
执行出错,提示
php fatal error:  call to undefined function cur_init() ;
但是已经安装了php5 php5-curl php-cli curl
#curl -v
curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 openssl/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
features: gss-negotiate idn ipv6 largefile ntlm ntlm_wb ssl libz tls-srp 
#php -v
php 5.3.10-1ubuntu3.13 with suhosin-patch (cli) (built: jul  7 2014 18:54:55) 
copyright (c) 1997-2012 the php group
zend engine v2.3.0, copyright (c) 1998-2012 zend technologies
但是查看是否加载了扩展,提示确实没有加载:
exception: extension curl does not exist
请问如何解决此问题呢?
回复讨论(解决方案) 你是把curl_init写成了cur_init了吗
你是把curl_init写成了cur_init了吗
哦,这个地方确实是写错,不过不是问题的原因。
改过来,运行结果:
php fatal error:  call to undefined function curl_init() in 
那可能就是配置问题了,curl已经安装 了的话,php配置文件里面有没有加扩展呢,添加curl扩展extension = curl.so ?
那可能就是配置问题了,curl已经安装 了的话,php配置文件里面有没有加扩展呢,添加curl扩展extension = curl.so ?
本身就是扩展的问题。正如最上面输入命令检测是否添加了该扩展:exception: extension curl does not exist
而且是添加了扩展,但是匹配的路径不对导致。
上午已经解决了。
关闭问题。多谢
其它类似信息

推荐信息