官方文档里面没有 针对 Centos 系统的安装说明,只能下载源码编译安装 https://www.php.net/manual/en/install.php 网上有一些 yum 源,主要有 http
官方文档里面没有 针对 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 -v
PHP 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
来源地址:https://blog.csdn.net/u010953609/article/details/129423771
--结束END--
本文标题: CentOS 7 yum 方式安装 php
本文链接: https://www.lsjlt.com/news/411348.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0