How to install php-curl in Ubuntu 16.04

你离开我真会死。 提交于 2019-11-26 12:08:42

问题


Upgraded to Ubuntu 16.04 and facing problem after installing PHP5.

Installed PHP-5 with following:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.5   # for PHP 5.5

Trying to install php-curl but its not working.

sudo apt-get install php5-curl

Error: E: Unable to locate package php5-curl


回答1:


In Ubuntu 16.04 default PHP version is 7.0, if you want to use different version then you need to install PHP package according to PHP version:

  • PHP 7.2: sudo apt-get install php7.2-curl
  • PHP 7.1: sudo apt-get install php7.1-curl
  • PHP 7.0: sudo apt-get install php7.0-curl
  • PHP 5.6: sudo apt-get install php5.6-curl
  • PHP 5.5: sudo apt-get install php5.5-curl



回答2:


This worked for me.

sudo apt-get install php-curl



回答3:


This works for me:

sudo apt-get install php5.6-curl



回答4:


Do:

apt-get update

And then:

apt-get install php5-curl



回答5:


To Install cURL 7.49.0 on Ubuntu 16.04 and Derivatives

wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
tar -xvf curl-7.49.0.tar.gz
cd curl-7.49.0/
./configure
make
sudo make install



回答6:


For Ubuntu 18.04 or PHP 7.2 users you can do:

apt-get install php7.2-curl

You can check your PHP version by running php -v to verify your PHP version and get the right curl version.




回答7:


sudo apt-get install php5.6-curl

and restart the web browser.

You can check the modules by running php -m | grep curl



来源:https://stackoverflow.com/questions/38800606/how-to-install-php-curl-in-ubuntu-16-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!