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 설치
1. 현재 시스템에 PHP가 설치되어 있는지 확인하세요
[root@localhost ~]# rpm -qa php
2. 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
3. 버전 및 지원되는 확장자를 확인하세요
[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 ~]#
5. php-mysqlnd 설치 현재 설치된 mysql 시스템 버전은
[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
[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
php-mysqlnd 대신 php-mysql이 설치된 경우 사용 시 경고가 표시됩니다. mysqli_connect() 함수:
PHP 경고: mysqli_connect(): 헤더와 클라이언트 라이브러리 부 버전이 일치하지 않습니다. 헤더:50556 라이브러리:50637
권장 학습: "
PHP 비디오 튜토리얼"
위 내용은 Centos yum에 php5.4를 설치하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!