CentOS 7 yum 方式安装 php
官方文档里面没有 针对 CentOS 系统的安装说明,只能下载源码编译安装
https://www.php.net/manual/en/install.php
网上有一些 yum 源,主要有 https://mirror.webtatic.com 和 Remi;s rpm repository
webtatic 的更新日期停留在 2016 年,Remi 比较新,所以选择 Remi;s rpm repository
安装步骤
-
安装 EPEL ( Extra Packages for Enterprise Linux )
yum install epel-release -
安装 yum-utils ,用于 yum-config-manager 管理 rpm
yum -y install yum-utils -
安装 remi rpm 源
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm -
查询
yum repolist all |grep php
全都是禁用状态...... remi-php80 Remi's PHP 8.0 RPM repository f 禁用 remi-php80-debuginfo/x86_64 Remi's PHP 8.0 RPM repository f 禁用 remi-php80-test Remi's PHP 8.0 test RPM reposit 禁用 remi-php80-test-debuginfo/x86_64 Remi's PHP 8.0 test RPM reposit 禁用 remi-php81 Remi's PHP 8.1 RPM repository f 禁用 remi-php81-debuginfo/x86_64 Remi's PHP 8.1 RPM repository f 禁用 remi-php81-test Remi's PHP 8.1 test RPM reposit 禁用 remi-php81-test-debuginfo/x86_64 Remi's PHP 8.1 test RPM reposit 禁用 remi-php82 Remi's PHP 8.2 RPM repository f 禁用: 299 remi-php82-debuginfo/x86_64 Remi's PHP 8.2 RPM repository f 禁用 remi-php82-test Remi's PHP 8.2 test RPM reposit 禁用 remi-php82-test-debuginfo/x86_64 Remi's PHP 8.2 test RPM reposit 禁用
-
启动需要安装的 php 版本的 rpm 源
yum-config-manager --enable remi-php82 -
安装 php 以及可能需要的模块
yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis php-calendar php-bcmath php-sockets php-session php-snmp
-
安装完成,查询确认.
php -vPHP 8.2.3 (cli) (built: Feb 14 2023 01:06:39) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.2.3, Copyright (c) Zend Technologies
systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: inactive (dead)
php -m
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhfijkjf
系列文章
更多
同类精品
更多
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
怎样阻止微信小程序自动打开
PHP中文网 06-13 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01