首页 后端开发 PHP7 CentOS7如何使用yum安装PHP7.3

CentOS7如何使用yum安装PHP7.3

May 20, 2021 pm 06:00 PM
centos7 yum

本篇文章给大家介绍一下CentOS7使用yum安装PHP7.3的方法。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

CentOS 7 yum安装 PHP7.3 教程

1、首先安装 EPEL 源:

yum install epel-release
登录后复制

安装 REMI 源:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
登录后复制

2、安装 Yum 源管理工具:

yum install yum-utils
登录后复制

3、安装 PHP7.3:

yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xmll
登录后复制

安装完成后最好重启一下计算机,不然有可能无法启动php

设置开机启动、运行服务:

systemctl enable php73-php-fpm
systemctl start php73-php-fpm
登录后复制

设置 PHP

查找安装包:

[root@xxx etc]# rpm -qa | grep 'php'php73-php-cli-7.3.6-1.el7.remi.x86_64
php73-php-mbstring-7.3.6-1.el7.remi.x86_64
php73-php-pecl-mcrypt-1.0.2-1.el7.remi.x86_64
php73-runtime-2.0-1.el7.remi.x86_64
php73-php-pdo-7.3.6-1.el7.remi.x86_64
php73-php-bcmath-7.3.6-1.el7.remi.x86_64
php73-php-fpm-7.3.6-1.el7.remi.x86_64
php73-php-mysqlnd-7.3.6-1.el7.remi.x86_64
php73-php-snmp-7.3.6-1.el7.remi.x86_64
php73-php-gd-7.3.6-1.el7.remi.x86_64
php73-php-json-7.3.6-1.el7.remi.x86_64
php73-php-soap-7.3.6-1.el7.remi.x86_64
php73-php-recode-7.3.6-1.el7.remi.x86_64
php73-php-pecl-crypto-0.3.1-5.el7.remi.x86_64
php73-php-common-7.3.6-1.el7.remi.x86_64
php73-php-opcache-7.3.6-1.el7.remi.x86_64
php73-php-pecl-geoip-1.1.1-6.el7.remi.x86_64
登录后复制

找到:php73-php-fpm-7.3.6-1.el7.remi.x86_64安装位置

[root@xxx etc]# rpm -ql php73-php-fpm-7.3.6-1.el7.remi.x86_64
/etc/logrotate.d/php73-php-fpm
/etc/opt/remi/php73/php-fpm.conf
/etc/opt/remi/php73/php-fpm.d
/etc/opt/remi/php73/php-fpm.d/www.conf
/etc/opt/remi/php73/sysconfig/php-fpm
/etc/systemd/system/php73-php-fpm.service.d
/opt/remi/php73/root/usr/sbin/php-fpm
/opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6
/opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6/php-fpm.conf.default
/opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6/www.conf.default
/opt/remi/php73/root/usr/share/fpm
/opt/remi/php73/root/usr/share/fpm/status.html
/opt/remi/php73/root/usr/share/licenses/php73-php-fpm-7.3.6
/opt/remi/php73/root/usr/share/licenses/php73-php-fpm-7.3.6/fpm_LICENSE
/opt/remi/php73/root/usr/share/man/man8/php-fpm.8.gz
/usr/lib/systemd/system/php73-php-fpm.service
/var/opt/remi/php73/lib/php/opcache
/var/opt/remi/php73/lib/php/session
/var/opt/remi/php73/lib/php/wsdlcache
/var/opt/remi/php73/log/php-fpm
/var/opt/remi/php73/run/php-fpm
登录后复制

查找php.ini位置:

[root@xxx etc]# find /etc/opt/remi/php73 -name php.ini/etc/opt/remi/php73/php.ini
登录后复制

编辑/etc/opt/remi/php73/php.ini替换换 ;cgi.fix_pathinfo=1 为 cgi.fix_pathinfo=0 快捷命令:

sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini
登录后复制

重启php73-php-fpm

systemctl restart php73-php-fpm
登录后复制

更多操作:

systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态
登录后复制

查看 PHP

验证一下是否安装成功:

root@mf88.biz-service:~# php73 -v
PHP 7.3.0-1+(cli) (built: Dec  6 2018 20:24:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
登录后复制

更新 PHP

运行下面的命令系统就会更新所有可以更新的软件包括 PHP

yum update
登录后复制

安装更多组件

上面的一条命令安装 PHP 只是安装了部分 PHP 拓展,更多的软件可见:

# yum search php73
Updating Subscription Management repositories.
Last metadata expiration check: 0:27:54 ago on Wed 15 May 2019 10:39:52 AM EDT.
============================================================================================= Name Exactly Matched: php73 ==============================================================================================
php73.x86_64 : Package that installs PHP 7.3
php73.x86_64 : Package that installs PHP 7.3
============================================================================================ Name & Summary Matched: php73 =============================================================================================
php73-syspaths.x86_64 : System-wide wrappers for the php73 package
php73-syspaths.x86_64 : System-wide wrappers for the php73 package
php73-scldevel.x86_64 : Package shipping development files for php73
php73-scldevel.x86_64 : Package shipping development files for php73
php73-php-zstd-devel.x86_64 : php73-php-zstd developer files (header)
php73-runtime.x86_64 : Package that handles php73 Software Collection.
php73-runtime.x86_64 : Package that handles php73 Software Collection.
php73-runtime.x86_64 : Package that handles php73 Software Collection.
php73-php-pecl-psr-devel.x86_64 : php73-php-pecl-psr developer files (header)
php73-php-pecl-psr-devel.x86_64 : php73-php-pecl-psr developer files (header)
php73-php-pecl-raphf-devel.x86_64 : php73-php-pecl-raphf developer files (header)
php73-php-pecl-raphf-devel.x86_64 : php73-php-pecl-raphf developer files (header)
php73-php-pecl-propro-devel.x86_64 : php73-php-pecl-propro developer files (header)
php73-php-pecl-yaconf-devel.x86_64 : php73-php-pecl-yaconf developer files (header)
php73-php-pecl-propro-devel.x86_64 : php73-php-pecl-propro developer files (header)
php73-php-pecl-yaconf-devel.x86_64 : php73-php-pecl-yaconf developer files (header)
php73-php-pecl-xmldiff-devel.x86_64 : php73-php-pecl-xmldiff developer files (header)
php73-php-pecl-swoole4-devel.x86_64 : php73-php-pecl-swoole4 developer files (header)
php73-php-pecl-xmldiff-devel.x86_64 : php73-php-pecl-xmldiff developer files (header)
php73-php-zephir-parser-devel.x86_64 : php73-php-zephir-parser developer files (headers)
php73-php-zephir-parser-devel.x86_64 : php73-php-zephir-parser developer files (headers)
php73-php-pecl-handlebars-devel.x86_64 : php73-php-pecl-handlebars developer files (header)
================================================================================================= Name Matched: php73 ==================================================================================================
php73-php.x86_64 : PHP scripting language for creating dynamic web sites
php73-php.x86_64 : PHP scripting language for creating dynamic web sites
php73-build.x86_64 : Package shipping basic build configuration
……
登录后复制

推荐学习:php视频教程

以上是CentOS7如何使用yum安装PHP7.3的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

CentOS7各个版本镜像下载地址及版本说明(包括Everything版) CentOS7各个版本镜像下载地址及版本说明(包括Everything版) Feb 29, 2024 am 09:20 AM

载CentOS-7.0-1406的时候,有很多可选则的版本,对于普通用户来说,不知道选择哪个好,下面做一下简单介绍:(1)CentOS-xxxx-LiveCD.ios和CentOS-xxxx-bin-DVD.iso有什么区别?前者只有700M,后者有3.8G。其差别不仅仅在大小上,其更本质的差别是,CentOS-xxxx-LiveCD.ios只能加载到内存里运行,不能安装。CentOS-xxx-bin-DVD1.iso才可以安装到硬盘上。(2)CentOS-xxx-bin-DVD1.iso,Ce

详解CentOS6.5使用yum升级gcc的步骤 详解CentOS6.5使用yum升级gcc的步骤 Dec 31, 2023 am 10:59 AM

因为需要用到C++11,但CentOS自带的gcc4.4.7不支持,所以决定升级gcc。操作如下:#备份mv/etc/yum.repos.d/devtools-2.repo/etc/yum.repos.d/devtools-2.repo.bakwgethttp://people.centos.org/tru/devtools-2/devtools-2.repo-O/etc/yum.repos.d/devtools-2.repoyuminstalldevtoolset-2-gccdevtoolse

CentOS 7 紧急修复模式的进入步骤 CentOS 7 紧急修复模式的进入步骤 Jan 13, 2024 am 09:36 AM

打开centos7页面出现:welcometoemergencymode!afterloggingin,type“journalctl-xb”toviewsystemlogs,“systemctlreboot”toreboot,“systemctldefault”totryagaintobootintodefaultmode。giverootpasswordformaintenance(??Control-D???):解决方法:执行r

如何在CentOS 7中访问并清理/tmp目录中的垃圾文件? 如何在CentOS 7中访问并清理/tmp目录中的垃圾文件? Dec 27, 2023 pm 09:10 PM

centos7系统中tmp目录下有很多垃圾,想要清除垃圾,该怎么清除呢?下面我们就来看看详细的教程。查看tmp文件目录下文件列表,执行命令cdtmp/切换到tmp当前文件目录,执行ll命令,查看当前目录下文件列表。如下图所示。使用rm删除文件命令,需要注意的是rm命令是将文件永远从系统中删除,因此建议在使用rm命令时,最好是在删除文件前给出提示。使用命令rm-i文件名,等用户确认删除(y)或跳过删除(n),系统进行相应的操作。如下图所示。

centos离线安装中文版GitLab centos离线安装中文版GitLab Feb 19, 2024 am 11:36 AM

1.下载gitlab安装包从【清华大学开源软件镜像站】下载最新中文版gitlab安装包,安装包里自带了简体中文汉化包。从【gitlab官网】下载gitlab最新安装包。2.安装gitlab以gitlab-ce-14.9.4-ce.0.el7.x86_64为例,将其上传至centos服务器使用yum安装gitlabyum-yinstallgitlab-ce-14.3.2-ce.0.el7.x86_64.rpm使用yum安装gityum-yinstallgit#安装git修改gitlab配置文件vi

CENTOS7下如何安装mbstring扩展? CENTOS7下如何安装mbstring扩展? Jan 06, 2024 pm 09:59 PM

1.UncaughtError:Calltoundefinedfunctionmb_strlen();出现如上错误时,说明我们没装上mbstring扩展;2.进入PHP安装目录cd/temp001/php-7.1.0/ext/mbstring3.启动phpize(/usr/local/bin/phpize或/usr/local/php7-abel001/bin/phpize)命令来安装php扩展4../configure--with-php-config=/usr/local/php7-abel

centos7如何设置密码规则?centos7设置密码规则的方法 centos7如何设置密码规则?centos7设置密码规则的方法 Jan 07, 2024 pm 01:17 PM

出于安全考虑设置密码规则设置密码到期的天数。用户必须在天内更改密码。此设置仅影响创建用户,而不会影响现有用户。如果设置为现有用户,请运行命令“chage-M(days)(user)”。PASS_MAX_DAYS60#密码到期时间PASS_MIN_DAYS3#初始密码更改时间PASS_MIN_LEN8#密码最小长度PASS_WARN_AGE7#密码过期提示时间重复密码限制使用[root@linuxprobe~]#vi/etc/pam.d/system-auth#nearline15:

CentOS7怎么安装Mysql并设置开机自启动 CentOS7怎么安装Mysql并设置开机自启动 Jun 02, 2023 pm 08:36 PM

centos7不带mysql数据库了,默认的数据库是mariadb(mysql的一个分支)。可以按照以下步骤手动安装mysql数据库。1.下载rpm安装文件wgethttp://repo.mysql.com/mysql-community-release-el7.rpm2.执行rpm安装rpm-ivhmysql-community-release-el7.rpm依赖解析完成后,出现下列选项:dependenciesresolved=================================

See all articles