2017-02-20 127 views
1

我使用Ubuntu 16.04服务器,我已经跑安装后Curl不工作,为什么?

sudo apt-get install php-curl 

,并得到输出:

php-curl is already the newest version 

当我运行:

curl -V 

我得到:

curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 
zlib/1.2.8 libidn/1.32 librtmp/2.3 
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 

在phpinfo( )页我没有看到卷曲启用/安装,当我运行任何卷曲功能我得到错误:

Fatal error: Uncaught Error: Call to undefined function curl_version() in ... 

昨天工作正常。我更新了PHP,现在它不再工作...

+1

尝试添加你的php版本号,当你安装php_curl,像'sudo apt-得到安装php7.1-curl'或'sudo apt-get install php5.6-curl' –

回答

2

为了使用卷曲你应该先启用它。找到你的php.ini文件并取消注释此行。

;extension=php_curl.dll 

不要忘记重新启动Apache ..

/opt/lampp/lampp service apache2 restart 
+0

并记住apache需要重新启动。 – Michael

+0

@Michael忘了提及它...感谢提醒我 – NID

+0

它dosent工作对我来说。我做的。 itnt it obey for windows,因为dll因为仅适用于windows ... – Dimitar

0

在我的情况的解决方案是使用安装卷曲:

sudo apt-get install php7.0-curl 

感谢@卡西米尔-ET -hippolyte