Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

php - Call to undefined function curl_init() even it is enabled in php7

I've just installed php7 to my Ubuntu. At first, there was no problem, my web site was working. But suddenly, it started to return Call to undefined function curl_init() error. Now, my pages contain curl codes do not work.

In phpinfo(), it looks Curl is enabled. There were similar questions but none of them handled it in php7. I thought it should be something different than others.

Edit: When I try

php -i | grep curl       

in terminal, it returns

/etc/php/7.0/cli/conf.d/20-curl.ini,
curl
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I've had similar problem with curl after upgrade to XX (16.04). After reinstalling curl with:

sudo apt-get install php-curl

And server restart

sudo service apache2 restart

everything went back to normal :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...