debian 安装php7_Debian 10.7安装PHP7.4和PHP8.0

本文介绍了如何在Debian 10.7系统中安装PHP 7.4和8.0。首先,更新并升级系统,然后添加Sury PHP仓库,安装必要的依赖。接着,使用apt命令安装PHP 7.4及其扩展,包括fpm、cli、gd等。最后,同样方式安装PHP 8.0及其扩展。通过这些步骤,用户可以在Debian 10.7上拥有PHP 7.4和8.0的环境。
摘要由CSDN通过智能技术生成

参考:https://idroot.us/install-php-7-4-debian-10/

1. 安装前升级系统:

sudo apt update

sudo apt upgrade

2. 在Debian 10.7安装PHP 7.4:

apt -y install lsb-release apt-transport-https ca-certificates wget

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

添加仓库:

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list

apt update

apt search php7.4

6c1555302777729326ca3efa0910d9ec.png

apt install php7.4

apt install php7.4-{fpm,cli,gd,bcmath,common,xml,xmlrpc,intl,soap,mbstring,mysql,ldap,opcache,bz2,zip}

6c1555302777729326ca3efa0910d9ec.png

6c1555302777729326ca3efa0910d9ec.png

apt search php8.0:

6c1555302777729326ca3efa0910d9ec.png

apt install php8.0

apt install php8.0-{fpm,cli,gd,bcmath,common,xml,xmlrpc,intl,soap,mbstring,mysql,ldap,opcache,bz2,zip}

6c1555302777729326ca3efa0910d9ec.png

3. 执行php脚本:

6c1555302777729326ca3efa0910d9ec.png

来源:oschina

链接:https://my.oschina.net/michaelshu/blog/4874469

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值