如何在 Ubuntu 16.04 中安装 php-curl [英] How to install php-curl in Ubuntu 16.04

查看:32
本文介绍了如何在 Ubuntu 16.04 中安装 php-curl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到 Ubuntu 16.04 并在安装 PHP5 后遇到问题.

安装了 PHP-5,如下:

sudo add-apt-repository ppa:ondrej/phpsudo apt-get 更新sudo apt-get 升级sudo apt-get install php5.5 # for PHP 5.5

尝试安装 php-curl 但它不起作用.

sudo apt-get install php5-curl

<块引用>

错误:E: 无法定位 php5-curl 包

解决方案

Ubuntu 16.04默认PHP版本为7.0,如果要使用不同版本则需要根据PHP版本安装PHP包:

  • PHP 7.4:sudo apt-get install php7.4-curl
  • PHP 7.3:sudo apt-get install php7.3-curl
  • 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

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

解决方案

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.4: sudo apt-get install php7.4-curl
  • PHP 7.3: sudo apt-get install php7.3-curl
  • 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

这篇关于如何在 Ubuntu 16.04 中安装 php-curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆