设置yum存储库
起首,需要在体系上启用Remi和EPEL yum存储库。运用以下敕令在CentOS和Red Hat 7/6体系上装置EPEL存储库
运用此敕令在体系上装置EPEL yum存储库
$ sudo yum install epel-release
如今依据你的操作体系版本实行以下敕令之一以装置REMI存储库。
$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
在CentOS上装置php 7
你的体系已准备好从yum存储库装置PHP。依据你的需求,运用以下敕令之一在体系上装置php 7.3、php 7.2或php 7.1。
## 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
假定已在体系上装置了最新版本的php 7.3。如今运转下面的敕令来搜检体系上当前运转的PHP版本。
$ php -v PHP 7.3.0 (cli) (built: Dec 4 2018 16:12:20) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
装置PHP模块
能够还需要依据应用程序需求装置其他PHP模块。下面的敕令将装置一些更有效的PHP模块。
### 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
能够运转以下敕令来搜刮设置yum存储库下的其他可用PHP模块。下面的示例敕令将搜刮PHP 7.3的一切模块。
$ yum --enablerepo=remi-php73 search php | grep php73 php73.x86_64 : Package that installs PHP 7.3 php73-php.x86_64 : PHP scripting language for creating dynamic web sites php73-php-bcmath.x86_64 : A module for PHP applications for using the bcmath php73-php-brotli.x86_64 : Brotli Extension for PHP php73-php-cli.x86_64 : Command-line interface for PHP php73-php-common.x86_64 : Common files for PHP php73-php-componere.x86_64 : Composing PHP classes at runtime php73-php-dba.x86_64 : A database abstraction layer module for PHP applications php73-php-dbg.x86_64 : The interactive PHP debugger php73-php-devel.x86_64 : Files needed for building PHP extensions php73-php-embedded.x86_64 : PHP library for embedding in applications php73-php-enchant.x86_64 : Enchant spelling extension for PHP applications php73-php-fpm.x86_64 : PHP FastCGI Process Manager php73-php-gd.x86_64 : A module for PHP applications for using the gd graphics ... ...
本篇文章到这里就已悉数完毕了,更多其他精彩内容人人能够关注ki4网的php视频教程栏目!!!
以上就是如安在CentOS和RHEL上装置PHP7的细致内容,更多请关注ki4网别的相干文章!