centos yum如何安装php5.4
发表于:2025-11-15 作者:千家信息网编辑
千家信息网最后更新 2025年11月15日,本篇内容主要讲解"centos yum如何安装php5.4",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"centos yum如何安装php5.4"吧!ce
千家信息网最后更新 2025年11月15日centos yum如何安装php5.4
本篇内容主要讲解"centos yum如何安装php5.4",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"centos yum如何安装php5.4"吧!
centos yum安装php5.4的方法:1、检查当前系统是否已经安装PHP;2、查看yum是否有可安装的PHP软件;3、通过"yum install php"安装php即可。

本文操作环境:CentOS 7.4.1708系统、php5.4版、DELL G3电脑
centos yum怎么安装php5.4?
CentOS 7.4 使用yum源安装PHP 5.4.16
一、检查当前系统是否已经安装PHP
[root@localhost ~]# rpm -qa php
二、查看yum是否有可安装的PHP软件
[root@localhost ~]# yum list | grep phpgraphviz-php.x86_64 2.30.1-19.el7 basephp.x86_64 5.4.16-43.el7_4 updatesphp-bcmath.x86_64 5.4.16-43.el7_4 updatesphp-cli.x86_64 5.4.16-43.el7_4 updatesphp-common.x86_64 5.4.16-43.el7_4 updatesphp-dba.x86_64 5.4.16-43.el7_4 updatesphp-devel.x86_64 5.4.16-43.el7_4 updatesphp-embedded.x86_64 5.4.16-43.el7_4 updatesphp-enchant.x86_64 5.4.16-43.el7_4 updatesphp-fpm.x86_64 5.4.16-43.el7_4 updatesphp-gd.x86_64 5.4.16-43.el7_4 updatesphp-intl.x86_64 5.4.16-43.el7_4 updatesphp-ldap.x86_64 5.4.16-43.el7_4 updatesphp-mbstring.x86_64 5.4.16-43.el7_4 updatesphp-mysql.x86_64 5.4.16-43.el7_4 updatesphp-mysqlnd.x86_64 5.4.16-43.el7_4 updatesphp-odbc.x86_64 5.4.16-43.el7_4 updatesphp-pdo.x86_64 5.4.16-43.el7_4 updatesphp-pear.noarch 1:1.9.4-21.el7 basephp-pecl-memcache.x86_64 3.0.8-4.el7 basephp-pgsql.x86_64 5.4.16-43.el7_4 updatesphp-process.x86_64 5.4.16-43.el7_4 updatesphp-pspell.x86_64 5.4.16-43.el7_4 updatesphp-recode.x86_64 5.4.16-43.el7_4 updatesphp-snmp.x86_64 5.4.16-43.el7_4 updatesphp-soap.x86_64 5.4.16-43.el7_4 updatesphp-xml.x86_64 5.4.16-43.el7_4 updatesphp-xmlrpc.x86_64 5.4.16-43.el7_4 updatesrrdtool-php.x86_64 1.4.8-9.el7 baseuuid-php.x86_64 1.6.2-26.el7 base
三、安装PHP
[root@localhost ~]# yum install php
四、查看版本及支持的扩展
[root@localhost ~]# php -vPHP 5.4.16 (cli) (built: Nov 15 2017 16:33:54)Copyright (c) 1997-2013 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@localhost ~]# php -m[PHP Modules]bz2calendarCorectypecurldateeregexiffileinfofilterftpgettextgmphashiconvjsonlibxmlmhashopensslpcntlpcrePharreadlineReflectionsessionshmopSimpleXMLsocketsSPLstandardtokenizerxmlzipzlib[Zend Modules][root@localhost ~]#
[root@localhost ~]# ll /etc/php.d/总用量 20-rw-r--r--. 1 root root 49 11月 16 00:36 curl.ini-rw-r--r--. 1 root root 57 11月 16 00:36 fileinfo.ini-rw-r--r--. 1 root root 49 11月 16 00:36 json.ini-rw-r--r--. 1 root root 49 11月 16 00:36 phar.ini-rw-r--r--. 1 root root 47 11月 16 00:36 zip.ini[root@localhost ~]# ll /usr/lib64/php/modules/总用量 3100-rwxr-xr-x. 1 root root 74688 11月 16 00:36 curl.so-rwxr-xr-x. 1 root root 2713376 11月 16 00:36 fileinfo.so-rwxr-xr-x. 1 root root 44688 11月 16 00:36 json.so-rwxr-xr-x. 1 root root 271992 11月 16 00:36 phar.so-rwxr-xr-x. 1 root root 58392 11月 16 00:36 zip.so
五、安装php-mysqlnd
当前系统已安装的mysql版本是:
[root@localhost ~]# rpm -qi mysql-community-serverName : mysql-community-serverVersion : 5.7.21Release : 1.el7Architecture: x86_64Install Date: 2018年02月13日 星期二 09时37分23秒Group : Applications/DatabasesSize : 775546923License : Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Under GPLv2 license as shown in the Description field.Signature : DSA/SHA1, 2017年12月28日 星期四 20时54分13秒, Key ID 8c718d3b5072e1f5Source RPM : mysql-community-5.7.21-1.el7.src.rpmBuild Date : 2017年12月28日 星期四 12时11分13秒Build Host : siv27.no.oracle.comRelocations : (not relocatable)Packager : MySQL Release EngineeringVendor : Oracle and/or its affiliatesURL : http://www.mysql.com/Summary : A very fast and reliable SQL database serverDescription :The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,and robust SQL (Structured Query Language) database server. MySQL Serveris intended for mission-critical, heavy-load production systems as wellas for embedding into mass-deployed software. MySQL is a trademark ofOracle and/or its affiliatesThe MySQL software has Dual Licensing, which means you can use the MySQLsoftware free of charge under the GNU General Public License(http://www.gnu.org/licenses/). You can also purchase commercial MySQLlicenses from Oracle and/or its affiliates if you do not wish to be bound by the terms ofthe GPL. See the chapter "Licensing and Support" in the manual forfurther info.The MySQL web site (http://www.mysql.com/) provides the latest news andinformation about the MySQL software. Also please see the documentationand the manual for more information.This package includes the MySQL server binary as well as related utilitiesto run and administer a MySQL server.
[root@localhost ~]# yum install php-mysqlnd
[root@localhost test]# ll /etc/php.d/总用量 48-rw-r--r--. 1 root root 49 11月 16 00:36 curl.ini-rw-r--r--. 1 root root 57 11月 16 00:36 fileinfo.ini-rw-r--r--. 1 root root 49 11月 16 00:36 json.ini-rw-r--r--. 1 root root 55 11月 16 00:36 mysqlnd.ini-rw-r--r--. 1 root root 69 11月 16 00:36 mysqlnd_mysqli.ini-rw-r--r--. 1 root root 67 11月 16 00:36 mysqlnd_mysql.ini-rw-r--r--. 1 root root 47 11月 16 00:36 pdo.ini-rw-r--r--. 1 root root 63 11月 16 00:36 pdo_mysqlnd.ini-rw-r--r--. 1 root root 61 11月 16 00:36 pdo_sqlite.ini-rw-r--r--. 1 root root 49 11月 16 00:36 phar.ini-rw-r--r--. 1 root root 55 11月 16 00:36 sqlite3.ini-rw-r--r--. 1 root root 47 11月 16 00:36 zip.ini[root@localhost test]# ll /usr/lib64/php/modules/总用量 3772-rwxr-xr-x. 1 root root 74688 11月 16 00:36 curl.so-rwxr-xr-x. 1 root root 2713376 11月 16 00:36 fileinfo.so-rwxr-xr-x. 1 root root 44688 11月 16 00:36 json.so-rwxr-xr-x. 1 root root 133136 11月 16 00:36 mysqlnd_mysqli.so-rwxr-xr-x. 1 root root 53584 11月 16 00:36 mysqlnd_mysql.so-rwxr-xr-x. 1 root root 256584 11月 16 00:36 mysqlnd.so-rwxr-xr-x. 1 root root 28784 11月 16 00:36 pdo_mysqlnd.so-rwxr-xr-x. 1 root root 116344 11月 16 00:36 pdo.so-rwxr-xr-x. 1 root root 29176 11月 16 00:36 pdo_sqlite.so-rwxr-xr-x. 1 root root 271992 11月 16 00:36 phar.so-rwxr-xr-x. 1 root root 51360 11月 16 00:36 sqlite3.so-rwxr-xr-x. 1 root root 58392 11月 16 00:36 zip.so
如果安装的是php-mysql,而不是php-mysqlnd,在使用函数mysqli_connect()时会有警告:
PHP Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637
到此,相信大家对"centos yum如何安装php5.4"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
用量
系统
星期
内容
方法
版本
软件
学习
检查
实用
更深
兴趣
函数
实用性
实际
操作简单
更多
朋友
环境
电脑
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库服务安全
大族服务器
传奇4电脑多开服务器配置
网络安全总体态势分析
网络安全主题班会活动方式
市南区手机软件开发公司
php内存数据库
阿里巴巴数据库用的是什么
电易宝服务器返回数据错误
网络安全应急指挥中心面试真题
浙江金华网络安全案件
模拟城市服务器中断
数据库安装挂起什么意思
华为国际网络安全应急论坛
北京交通大学数据库考试题
排查linux服务器
网络安全防护动漫
数据库查看表头内容语句
A4输入法软件开发
isc企业网络安全
安徽技术管理软件开发平台
树立价值观 网络安全
高职计算机网络技术日常
数据库入门自学教程
滁州专业模具软件开发费用
网络安全报名技巧
云服务器统一管理
嘉定区软件开发哪家好
齐鲁软件开发大赛
服务器安装系统进入grub