2017-02-20 122 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