2023年2月16日15:38:38
官方说明: https://www.alibabacloud.com/help/zh/elastic-compute-service/latest/manually-deploy-an-lnmp-environment-on-an-ecs-instance-that-runs-alibaba-cloud-linux-2
官方安装的是PHP7.0我这里说下怎么安装PHP8以及如何安装PHP扩展
1. 添加yum源
1 yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm 2 3 rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
2. 搜索PHP可用版本
yum search php //注意不要用yum list php 不然只有php5.4
3. 安装php82
yum install -y php82
4. 查询PHP版本
1 php -v 2 3 PHP 8.2.3 (cli) (built: Feb 14 2023 01:06:39) (NTS gcc x86_64) 4 Copyright (c) The PHP Group 5 Zend Engine v4.2.3, Copyright (c) Zend Technologies
5. 查询PHP默认安装的扩展
php -m
6. 安装PHP mbstring扩展
1 // 搜索 mbstring 2 yum search php | grep php82 | grep mbstring 3 4 //结果: 5 php82-php-mbstring.x86_64 : A module for PHP applications which need multi-byte 6 7 //安装 8 yum install -y php82-php-mbstring 9 10 //检查是否安装了 11 php -m | grep mbstring
7. 安装其他扩展
1 yum install -y php82-php-fpm.x86_64 2 3 yum install -y install php82-php-mysqlnd.x86_64
标签:php,install,php82,LNMP,yum,mbstring,linux,PHP,cloud From: https://www.cnblogs.com/iLoveMyD/p/17127099.html