aptget php opcache,ubuntu下apt安装php7.4最全攻略

php7.4于2019年底发布,而截至2020/04月国内提供apt下载7.4的源还有没有,只能求于国外的源,但速度慢实在无法容忍。这里介绍下全套的安装方法

1. 安装apt常用工具包

sudo apt-get -y install

Ps:Ubuntu 16.04 LTS 后使用 apt 取代 apt-get

2. 使用apt-fast 提升下载速度的软件,安装软件时,通过增加线程使下载软件速度加快。

sudo add-apt-repository ppa:apt-fast/stable

sudo apt-get install apt-fast

先添加apt-fast的安装源 然后安装。在出现的GUI画面依此选择替换apt-get, 设置最大16线程,和yes。到这一步就安装好了apt-fast

卸载系统中已有的php版本和扩展

sudo apt-get autoremove php*

添加php7.4的源

sudo add-apt-repository ppa:ondrej/php && sudo apt-get update

使用apt-fast 安装php7.4

sudo apt-fast -y install php7.4

安装php7.4必要的扩展

sudo -y apt-fast install php7.4-dev //phpize需要

sudo -y apt-fast install php-pear //pecl需要

sudo -y apt-fast install php7.4-fpm php7.4-mysql php7.4-curl php7.4-json php7.4-mbstring php7.4-xml php7.4-intl

安装可选扩展

sudo apt-fast install php7.4-gd

sudo apt-fast install php7.4-soap

sudo apt-fast install php7.4-gmp

sudo apt-fast install php7.4-odbc

sudo apt-fast install php7.4-pspell

sudo apt-fast install php7.4-bcmath

sudo apt-fast install php7.4-enchant

sudo apt-fast install php7.4-ldap

sudo apt-fast install php7.4-opcache

sudo apt-fast install php7.4-readline

sudo apt-fast install php7.4-sqlite3

sudo apt-fast install php7.4-xmlrpc

sudo apt-fast install php7.4-bz2

sudo apt-fast install php7.4-interbase

sudo apt-fast install php7.4-pgsql

sudo apt-fast install php7.4-recode

sudo apt-fast install php7.4-sybase

sudo apt-fast install php7.4-xsl

sudo apt-fast install php7.4-cgi

sudo apt-fast install php7.4-dba

sudo apt-fast install php7.4-phpdbg

sudo apt-fast install php7.4-snmp

sudo apt-fast install php7.4-tidy

sudo apt-fast install php7.4-zip*

到这里就安装完成! 想体验极速的php7.4预加载的伙伴,可以一试了。 本文由 www.7php.cn 原创

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值