centos7下yum安装PHP 7.4, 7.3 & 7.2 & 7.1

星期二, 2021-03-09 | Author: Lee | linux, php | 97 views

centos7下yum安装PHP 7.4, 7.3 & 7.2 & 7.1

1.系统为centos7.9

2.使用yum安装 命令如下:

  sudo yum install epel-release
 
  sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

2.1:安装php版本

  ## Install PHP 7.4 
  yum --enablerepo=remi-php74 install php
 
  ## Install PHP 7.3 
  yum --enablerepo=remi-php73 install php
 
  ## Install PHP 7.2 
  yum --enablerepo=remi-php72 install php
 
  ## Install PHP 7.1 
  yum --enablerepo=remi-php71 install php

2.2 安装php相关常用扩展(Modules)

	### For PHP 7.4
yum --enablerepo=remi-php74 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
 
### For PHP 7.3
yum --enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
 
### For PHP 7.2
yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
 
### For PHP 7.1
yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

2.3 支持mysql及php-fpm

  ## For PHP 7.4 
  yum --enablerepo=remi-php74 install php-fpm mysqlnd
 
  ## For PHP 7.3 
  yum --enablerepo=remi-php73 install php-fpm mysqlnd
 
  ## For PHP 7.2 
  yum --enablerepo=remi-php72 install php-fpm mysqlnd
 
  ## For PHP 7.1 
  yum --enablerepo=remi-php71 install php-fpm mysqlnd

2.4 查看更多可安装的模块

  yum --enablerepo=remi-php74 search php | grep php74
 
 
	 * php74.x86_64 : Package that installs PHP 7.4
	php74-php.x86_64 : PHP scripting language for creating dynamic web sites
	php74-php-bcmath.x86_64 : A module for PHP applications for using the bcmath
	php74-php-brotli.x86_64 : Brotli Extension for PHP
	php74-php-cli.x86_64 : Command-line interface for PHP
	php74-php-common.x86_64 : Common files for PHP
	php74-php-componere.x86_64 : Composing PHP classes at runtime
	php74-php-dba.x86_64 : A database abstraction layer module for PHP applications
	php74-php-dbg.x86_64 : The interactive PHP debugger
	php74-php-devel.x86_64 : Files needed for building PHP extensions
	php74-php-embedded.x86_64 : PHP library for embedding in applications
	php74-php-enchant.x86_64 : Enchant spelling extension for PHP applications
	php74-php-fpm.x86_64 : PHP FastCGI Process Manager
	php74-php-gd.x86_64 : A module for PHP applications for using the gd graphics
	php74-php-geos.x86_64 : PHP module for GEOS
	php74-php-gmp.x86_64 : A module for PHP applications for using the GNU MP
	php74-php-imap.x86_64 : A module for PHP applications that use IMAP
	php74-php-intl.x86_64 : Internationalization extension for PHP applications
	php74-php-json.x86_64 : JavaScript Object Notation extension for PHP
	php74-php-ldap.x86_64 : A module for PHP applications that use LDAP
	php74-php-libvirt.x86_64 : PHP language binding for Libvirt
	php74-php-libvirt-doc.noarch : Document of php-libvirt
	php74-php-litespeed.x86_64 : LiteSpeed Web Server PHP support
	php74-php-lz4.x86_64 : LZ4 Extension for PHP
	php74-php-mbstring.x86_64 : A module for PHP applications which need multi-byte
	php74-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL
	php74-php-oci8.x86_64 : A module for PHP applications that use OCI8 databases
	php74-php-odbc.x86_64 : A module for PHP applications that use ODBC databases
	php74-php-pdlib.x86_64 : A PHP extension for Dlib
	php74-php-pdo.x86_64 : A database access abstraction module for PHP applications
	php74-php-pear.noarch : PHP Extension and Application Repository framework
	php74-php-pecl-cassandra.x86_64 : DataStax PHP Driver for Apache Cassandra
	php74-php-pecl-couchbase2.x86_64 : Couchbase Server PHP extension
	............

2.5启动php-fpm

  systemctl start php-fpm
 
  systemctl stop php-fpm

2.6 查看安装的php版本信息

  php -v
 
 
PHP 7.4.16 (cli) (built: Mar  2 2021 10:35:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

3.php-fpm优化参考 可以查询 www.conf文件进行已修改配置
centos7下的php-fpm的优化

Tags: , ,

文章作者: Lee

本文地址: https://www.pomelolee.com/2138.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Meta