专栏首页热爱ITCentOS 7 yum 安装 PHP7.3 教程

CentOS 7 yum 安装 PHP7.3 教程

参考:https://www.mf8.biz/centos-rhel-install-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 1 设置 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 1 编辑/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 #检查状态 1 2 3 查看 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 1 2 3 4 更新 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 ……

[转自]https://blog.csdn.net/laohe08/article/details/93166590

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • centos 6.8 yum安装 PHP 5.6

    (adsbygoogle = window.adsbygoogle || []).push({});

    双面人
  • CentOS下yum安装PHP,配置php-fpm服务

    # rpm -Uvh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8....

    双面人
  • 新手微擎 --- 框架整体认知

    首先贴出微擎根目录各文件夹、文件的大致含义(写的有点乱,仔细看还是能看懂的,O(∩_∩)O):

    双面人
  • Windows环境配置Apache+Mysql+PHP

    一、安装配置Apache2.4.7(httpd-2.4.7-win64-VC11.zip ) 1、解压下载的安装包:httpd-2.4.7-...

    庞小明
  • Deepin nginx lumen配置

    启动后将 /etc/nginx/sites-enabled/default 配置文件 copy一份到 /etc/nginx/conf.d/lumen_demo....

    烟草的香味
  • SAP最佳业务实践:FI–自建资产(资本投资订单)(164)-6 KO04维护最终结算的结算规则

    4.8 KO04维护最终结算的结算规则 在本步骤中,将维护最终结算的结算规则。投资订单的状态将被设置为“技术性结账”。这一状态将允许订单的最终结算。 必须成功...

    SAP最佳业务实践
  • 腾讯AI加速器二期交答卷:9个月、40个项目、50余个行业解决方案

    4月28日,腾讯AI加速器第二期项目迎来毕业礼。从全球1500个AI企业中甄选出的40个AI项目,覆盖医疗、零售、农业、机器人、无人驾驶等20多个领域,经过9个...

    量子位
  • 消息中间件Kafaka - PHP操作使用Kafka

    这个位置就是保存的我们刚刚安装的扩展 进入该目录 cd /usr/local/php/lib/php/extensions/no-debug-non-zts-...

    gaobinzhan
  • PHP程序员必须知道的两种日志实例分析

    作为一名程序员,比码代码还重要那么一点点的东西就是日志的分析和查询。下面列出常见日志及设置方法。

    砸漏
  • Linux下安装PHP curl扩展的方法详解

    本文实例讲述了Linux下安装PHP curl扩展的方法。分享给大家供大家参考,具体如下:

    砸漏

扫码关注云+社区

领取腾讯云代金券