如何在Ubuntu 16.04中安装php-curl

时间:2021-03-13 23:41:05

Upgraded to Ubuntu 16.04 and facing problem after installing PHP5.

升级到Ubuntu 16.04并在安装PHP5后面临问题。

Installed PHP-5 with following:

安装PHP-5如下:

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.

试图安装php-curl但它无法正常工作。

sudo apt-get install php5-curl

Error: E: Unable to locate package php5-curl

错误:E:无法找到包php5-curl

5 个解决方案

#1


115  

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:

在Ubuntu 16.04中,默认的PHP版本是7.0,如果你想使用不同的版本,那么你需要根据PHP版本安装PHP包:

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

#2


20  

This works for me:

这对我有用:

sudo apt-get install php5.6-curl

#3


20  

This worked for me.

这对我有用。

sudo apt-get install php-curl

#4


3  

To Install cURL 7.49.0 on Ubuntu 16.04 and Derivatives

在Ubuntu 16.04和Derivatives上安装cURL 7.49.0

  • wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
  • wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
  • tar -xvf curl-7.49.0.tar.gz
  • tar -xvf curl-7.49.0.tar.gz
  • cd curl-7.49.0/
  • cd curl-7.49.0 /
  • ./configure
  • 。/配置
  • make
  • 使
  • .sudo make install
  • .sudo make install

#5


3  

Do:

做:

# apt-get update

And then:

接着:

# apt-get install php5-curl

#1


115  

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:

在Ubuntu 16.04中,默认的PHP版本是7.0,如果你想使用不同的版本,那么你需要根据PHP版本安装PHP包:

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

#2


20  

This works for me:

这对我有用:

sudo apt-get install php5.6-curl

#3


20  

This worked for me.

这对我有用。

sudo apt-get install php-curl

#4


3  

To Install cURL 7.49.0 on Ubuntu 16.04 and Derivatives

在Ubuntu 16.04和Derivatives上安装cURL 7.49.0

  • wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
  • wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
  • tar -xvf curl-7.49.0.tar.gz
  • tar -xvf curl-7.49.0.tar.gz
  • cd curl-7.49.0/
  • cd curl-7.49.0 /
  • ./configure
  • 。/配置
  • make
  • 使
  • .sudo make install
  • .sudo make install

#5


3  

Do:

做:

# apt-get update

And then:

接着:

# apt-get install php5-curl