How to install php-curl in Ubuntu 16.04

匿名 (未验证) 提交于 2019-12-03 02:05:01

问题:

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 works for me:

sudo apt-get install php5.6-curl


回答3:

This worked for me.

sudo apt-get install php-curl


回答4:

To Install cURL 7.49.0 on Ubuntu 16.04 and Derivatives



回答5:

Do:

# apt-get update

And then:

# apt-get install php5-curl


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