分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

centos/RHEL 7.6 使用yum安装php7.3(方便wordpress的php7.3需求,并解决了libphp7.so缺失问题)

发布时间:2023-09-06 02:31责任编辑:白小东关键词:word

我最近想安装一个wordpress, 但是官网介绍需要php7.3以上版本,但是百度了一下,都是要编译安装。

为此,我想,centos..., php... 两大当红辣子鸡没有yum安装方式,简直不可能。

为此,我搜寻了各种源,发现remi源有php73。

但是我yum install 以后,发现两个致命的问题:

(1)php -v 不会显示任何东西,要php73 -v 才行

(2)建立一个phpinfo的测试页,没有任何反应,据研究是apache缺乏libphp7.so模块,各种教程都让我编译的时候加一个参数,但我是yum安装的啊。

于是乎,我找到了一个外国教程,安装后完美解决上述问题。

开题声明:翻译自:https://tecadmin.net/install-php7-on-centos7/

《如何将PHP7.3,7.2, 7.1 安装在centos/RHEL 7.6 上?》

  PHP7.3是PHP最新的稳定发行版,很多流行的yum仓库都提供php7的rpm安装包,这篇文章用Remi和EPEL仓库将安装包安装至你的系统。这篇文章帮你将PHP7.3, 7.2, 7.1服务安装至你的系统,这篇教程经过了centos7.4.1708的测试(实际上译者用7.6也可用)。

设置你的yum仓库

  首先,你需要安装remi和EPEL仓库,使用下面的命令安装:

安装EPEL:

sudo yum install epel-release

安装remi:

sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

  

安装PHP7

(译者:根据需求选择一个指令即可)

## 安装PHP 7.3 yum --enablerepo=remi-php73 install php## 安装 PHP 7.2 yum --enablerepo=remi-php72 install php## 安装 PHP 7.1 yum --enablerepo=remi-php71 install php 

我安装了php7.3, 通过下面指令检测是否正确运行:

php -vPHP 7.3.0 (cli) (built: Dec ?4 2018 16:12:20) ( NTS )Copyright (c) 1997-2018 The PHP GroupZend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

  

安装PHP模块

  你可能需要安装以下PHP模块,下面是一些有用的模块的安装指令。(译者:如果你不安装,就会缺这缺那,比方说libphp7.so)

### For PHP 7.3yum --enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt### For PHP 7.2yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt### For PHP 7.1yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

  你也可以通过下面的指令搜寻一些其它php模块,下面的示例指令将列出remi仓库下所有PHP7.3可用模块。

yum --enablerepo=remi-php73 search php | grep php73php73.x86_64 : Package that installs PHP 7.3php73-php.x86_64 : PHP scripting language for creating dynamic web sitesphp73-php-bcmath.x86_64 : A module for PHP applications for using the bcmathphp73-php-brotli.x86_64 : Brotli Extension for PHPphp73-php-cli.x86_64 : Command-line interface for PHPphp73-php-common.x86_64 : Common files for PHPphp73-php-componere.x86_64 : Composing PHP classes at runtimephp73-php-dba.x86_64 : A database abstraction layer module for PHP applicationsphp73-php-dbg.x86_64 : The interactive PHP debuggerphp73-php-devel.x86_64 : Files needed for building PHP extensionsphp73-php-embedded.x86_64 : PHP library for embedding in applicationsphp73-php-enchant.x86_64 : Enchant spelling extension for PHP applicationsphp73-php-fpm.x86_64 : PHP FastCGI Process Managerphp73-php-gd.x86_64 : A module for PHP applications for using the gd graphics......

  

结尾再次声明,翻译自:https://tecadmin.net/install-php7-on-centos7/

centos/RHEL 7.6 使用yum安装php7.3(方便wordpress的php7.3需求,并解决了libphp7.so缺失问题)

原文地址:https://www.cnblogs.com/chenyansu/p/10312238.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved