在ubuntu下顯示:Call to undefined function curl_init()問題的解決方法

Ubuntu Sed PHP Windows 安卓網hiapk 2017-05-19

聲明:我使用的是php5.5

查看你的php版本的方法是輸入:php -v

如果顯示:The program 'php5' is currently not installed. You can install it by typing:apt-get install php5-cli

那麼先輸入:sudo apt-get install php5-cli

然後再輸入:php -v

好了,進入正題

產生問題原因:你可能是在windows下寫了關於curl的一個有用的操作,但是把代碼放上你的託管服務器上的時候出現了這個問題。原因很簡單,你沒有在你的託管服務器上安裝curl

解決方法:安裝curl即可

具體操作:

1、sudo apt-get update

2、sudo sed -i -e 's/us.archive.ubuntu.com/archive.com/g' /etc/apt/sources.list

3、sudo apt-get install libcurl3 php5-curl

相關推薦

推薦中...