[ubuntu]

WBOY
Release: 2016-06-23 13:50:16
Original
922 people have browsed it

$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
而且是添加了扩展,但是匹配的路径不对导致。
上午已经解决了。
关闭问题。多谢
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!