Jtti广告广告
返回顶部
首页 > 资讯 > 后端开发 > PHP编程 >centos yum怎么安装php5.4
  • 296
分享到

centos yum怎么安装php5.4

yumphp5.4 2021-12-10 16:12:36 296人浏览 绘本
摘要

本文操作环境:Centos 7.4.1708系统、PHP5.4版、DELL G3电脑centos yum怎么安装php5.4?CentOS 7.4 使用yum源安装php 5.4.16一、检查当前系统是否已经安装PHP[root@local

本文操作环境: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 php
graphviz-php.x86_64                         2.30.1-19.el7              base
php.x86_64                                  5.4.16-43.el7_4            updates
php-bcmath.x86_64                           5.4.16-43.el7_4            updates
php-cli.x86_64                              5.4.16-43.el7_4            updates
php-common.x86_64                           5.4.16-43.el7_4            updates
php-dba.x86_64                              5.4.16-43.el7_4            updates
php-devel.x86_64                            5.4.16-43.el7_4            updates
php-embedded.x86_64                         5.4.16-43.el7_4            updates
php-enchant.x86_64                          5.4.16-43.el7_4            updates
php-fpm.x86_64                              5.4.16-43.el7_4            updates
php-gd.x86_64                               5.4.16-43.el7_4            updates
php-intl.x86_64                             5.4.16-43.el7_4            updates
php-ldap.x86_64                             5.4.16-43.el7_4            updates
php-mbstring.x86_64                         5.4.16-43.el7_4            updates
php-Mysql.x86_64                            5.4.16-43.el7_4            updates
php-mysqlnd.x86_64                          5.4.16-43.el7_4            updates
php-odbc.x86_64                             5.4.16-43.el7_4            updates
php-pdo.x86_64                              5.4.16-43.el7_4            updates
php-pear.noarch                             1:1.9.4-21.el7             base
php-pecl-memcache.x86_64                    3.0.8-4.el7                base
php-pgsql.x86_64                            5.4.16-43.el7_4            updates
php-process.x86_64                          5.4.16-43.el7_4            updates
php-pspell.x86_64                           5.4.16-43.el7_4            updates
php-recode.x86_64                           5.4.16-43.el7_4            updates
php-snmp.x86_64                             5.4.16-43.el7_4            updates
php-soap.x86_64                             5.4.16-43.el7_4            updates
php-xml.x86_64                              5.4.16-43.el7_4            updates
php-xmlrpc.x86_64                           5.4.16-43.el7_4            updates
rrdtool-php.x86_64                          1.4.8-9.el7                base
uuid-php.x86_64                             1.6.2-26.el7               base

三、安装PHP

[root@localhost ~]# yum install php

四、查看版本及支持的扩展

[root@localhost ~]# php -v
PHP 5.4.16 (cli) (built: Nov 15 2017 16:33:54)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@localhost ~]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
JSON
libxml
mhash
openssl
pcntl
pcre
Phar
readline
Reflection
session
shmop
SimpleXML
Sockets
SPL
standard
tokenizer
xml
zip
zlib

[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-server
Name        : mysql-community-server
Version     : 5.7.21
Release     : 1.el7
Architecture: x86_64
Install Date: 2018年02月13日 星期二 09时37分23秒
Group       : Applications/Databases
Size        : 775546923
License     : 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 8c718d3b5072e1f5
Source RPM  : mysql-community-5.7.21-1.el7.src.rpm
Build Date  : 2017年12月28日 星期四 12时11分13秒
Build Host  : siv27.no.oracle.com
Relocations : (not relocatable)
Packager    : MySQL Release Engineering <mysql-build@oss.oracle.com>
Vendor      : Oracle and/or its affiliates
URL         : Http://www.mysql.com/
Summary     : A very fast and reliable SQL database server
Description :
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
Oracle and/or its affiliates

The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from Oracle and/or its affiliates if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.

The MySQL WEB site (http://www.mysql.com/) provides the latest news and
infORMation about the MySQL software.  Also please see the documentation
and the manual for more information.

This package includes the MySQL server binary as well as related utilities
to 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

--结束END--

本文标题: centos yum怎么安装php5.4

本文链接: https://www.lsjlt.com/news/356.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • centos修改字符编码使centos支持中文
    本篇内容主要讲解“centos修改字符编码使centos支持中文”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“centos修改字符编码使centos支持中文”吧!一、中文支持安装中文语言包:代码...
    831
    2023-09-29
  • 为什么红帽为了CentOS Stream 而抛弃 CentOS
    本篇文章为大家展示了为什么红帽为了CentOS Stream 而抛弃 CentOS,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。不,这不是 IBM 在发号施令。这个决定是红帽内部出于商业上的原因做出...
    178
    2023-09-29
  • CentOS8怎么转换为CentOS Stream
    这篇文章主要讲解了“CentOS8怎么转换为CentOS Stream”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CentOS8怎么转换为CentOS Stream”吧!Centos St...
    544
    2023-09-29
  • CentOS安装MariaDB
    配置repo源 官方yum源生成器:https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna 创建并编辑/etc/yum.repos...
    812
    2023-09-29
    安装 maria db
  • centos安装memcache
    1.安装Memcached前需要先安装libevent,首先用wget下载libevent: wget http://www.monkey.org/~provos/libevent-1.4.13-...
    668
    2023-09-29
    memcache ce
  • Centos安装mysql
    记录一下Centos下安装mysql的过程实验环境: centos 7, mysql5.7社区版1.下载mysql5.7社区版安装包2.centos上直接解压安装,没有遇到任何障碍。3.安装过程中会把初始密...
    137
    2023-09-29
    centos mysql 安装
  • CentOS修改ulimit
    查看limit配置# ulimit -a core file size          (bloc...
    263
    2023-09-29
    CentOS ulimit
  • centos opencv + pyth
    Table of Contents 1. Installing OpenCV from source 1.1. We need CMake to configure the installation, GCC for compil...
    361
    2023-09-29
    centos opencv pyth
  • CentOS安装Python
    cd /usr/local/src/          #安装在这wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xztar -xvJf Python-3.5.1....
    208
    2023-09-29
    CentOS Python
  • CentOS如何部署
    这篇文章将为大家详细讲解有关CentOS如何部署,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。CentOS部署1 win7/win10 装VM 1.2 win7-->linux 鼠标左键 鼠标会进入...
    450
    2023-09-29
  • CentOS怎么分区
    本篇内容主要讲解“CentOS怎么分区”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“CentOS怎么分区”吧!( 1 )最基本分区方案: / :建议大小在 5GB 以上。 swap :即交换分区...
    572
    2023-09-29
  • centOS 安装gcc
    进入家目录cd ~输入sudo yum -y install gcc gcc-c++ kernel-devel等待安装,出现Complete!即可说明安装成功。测试 (1)新建.c文件touch main.c (2)利用centOS自带的g...
    855
    2023-09-29
    centos linux 服务器
  • CentOS升级openssh
    CentOS升级openssh 公司几台服务器扫出了几个openssh相关的漏洞,解决办法就是升级openssh版本。升级过程中踩坑较多,故作此博客记录。 !!!前排提示:离线环境可用以下命令在本地预先下载好依赖包 法一: yum inst...
    463
    2023-09-29
    centos 服务器 linux
  • Centos修改IP
    1.首先先cd到network-scripts目录,让后使用ll命令显示目录下的文件,第一个文件一般就是你的网卡配置文件 cd /etc/sysconfig/network-scripts  2.使用vim打开编辑这个文件     根...
    336
    2023-09-29
    linux 运维 服务器
  • CentOS磁盘挂载
    在购买云服务的时候,一般都会自带一块40G的系统盘,然后自己在选购数据盘,如果是windows系统,购买的数据盘会作为一个分区存在,比如D盘、E盘等,可以直接使用,但是在Linux必须进行挂载才能正常使用。 目录 一、挂载概念 二、查...
    869
    2023-09-29
    linux 运维 服务器 1024程序员节
  • Centos 安装 MySQL
    目录 一、准备 二、使用MobaXterm远程连接服务器 三、安装 MySQL 5.7 1.检查 temp 目录权限 2.安装前检测依赖  3.安装过程 四、安装 MySQL 8.0 一、准备 MobaXterm:支持远程终端登软件。 ...
    326
    2023-09-29
    mysql centos 数据库
  • CentOS 7与CentOS 6的区别是什么
    这篇文章给大家介绍CentOS 7与CentOS 6的区别是什么,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。CentOS 7与CentOS 6的区别【199cloud-艾娜】(1)桌面系统 [CentOS 6] GN...
    645
    2023-09-29
  • 如何将CentOS 8转换为CentOS Stream
    今天就跟大家聊聊有关如何将CentOS 8转换为CentOS Stream,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。CentOS  Stream是一个持续交付的Linu...
    859
    2023-09-29
  • Centos怎么设置静态IP及修改Centos配置文件
    这篇文章主要讲解了“Centos怎么设置静态IP及修改Centos配置文件”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Centos怎么设置静态IP及修改Centos配置文件”吧!特别值得一...
    321
    2023-09-29
  • CentOS7怎么快速升级到CentOS8
    这篇“CentOS7怎么快速升级到CentOS8”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“CentOS7怎么快速升级到C...
    505
    2023-09-29
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作