ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

CentOS 7 安装PHP 5.4.16

2021-01-17 10:01:00  阅读:188  来源: 互联网

标签:11 00 php 5.4 CentOS 16 36 PHP root


一、检查当前系统是否已经安装PHP

# rpm -qa php1

二、查看yum是否有可安装的PHP软件

# yum list | grep php1
[root@localhost ~]# yum list | grep phpgraphviz-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               base12345678910111213141516171819202122232425262728293031

三、安装PHP

# yum install php1

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

# php -v1
[root@localhost ~]# php -vPHP 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 Technologies1234
# php -m1
[root@localhost ~]# php -m[PHP Modules]bz2
calendar
Core
ctypecurldateereg
exif
fileinfo
filterftpgettext
gmphashiconvjson
libxml
mhash
openssl
pcntl
pcre
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
tokenizer
xmlzipzlib[Zend Modules]1234567891011121314151617181920212223242526272829303132333435363738
[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.so1234567891011121314

五、

当前系统已安装的mysql版本是:

# rpm -qi mysql-community-server1
[root@localhost ~]# rpm -qi mysql-community-serverName        : 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 forfurther 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.1234567891011121314151617181920212223242526272829303132333435363738

安装php-mysqlnd

# yum install php-mysqlnd1
[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.so12345678910111213141516171819202122232425262728

如果安装的是php-mysql,而不是php-mysqlnd,在使用函数mysqli_connect()时会有警告:PHP Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637

标签:11,00,php,5.4,CentOS,16,36,PHP,root
来源: https://blog.csdn.net/jialiang8542/article/details/112728431

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有