How to Install PHP 7 on CentOS/RHEL 7.1 & 6.7

PHP 7.0 is the latest stable release of PHP. May of popular yum repositories are providing rpm packages for PHP 7. This article is using webtatic yum repository and used the same for testing on CentOS 7 server. This article will help you to install PHP 7 on CentOS & Red Hat 7.1 & 6.7 servers.

Install Yum Repository

First you need to enable Webtatic and EPEL yum repositories on your system. Use the following command to install EPEL repository on your CentOS and Red Hat 7/6 systems

Use this command to install epel-release yum repository.

# yum install epel-release

and now execute one of following command as per your operating system version to install webtatic yum repository.

CentOS/RHEL 7
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6
# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Install PHP 7

Use the following command to install PHP 7 on your system.

# yum install php70w

Verify Install PHP Version

Now use the following command to check installed php version on your system.

# php -v

PHP 7.0.0 (cli) (built: Dec  2 2015 20:42:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

Install PHP Modules

You may also want to install additional php modules based on your application requirements. Below command will install some more useful php modules.

# yum install php70w-xml php70w-soap php70w-xmlrpc
# yum install php70w-mbstring php70w-json php70w-gd php70w-mcrypt

记得最后要重启apache-server

#sudo service httpd restart

To find out other available php modules use the following command.

# yum search php70 


php70w.x86_64 : PHP scripting language for creating dynamic web sites
php70w-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php70w-cli.x86_64 : Command-line interface for PHP
php70w-common.x86_64 : Common files for PHP
php70w-dba.x86_64 : A database abstraction layer module for PHP applications
php70w-devel.x86_64 : Files needed for building PHP extensions
php70w-embedded.x86_64 : PHP library for embedding in applications
php70w-enchant.x86_64 : Enchant spelling extension for PHP applications
php70w-fpm.x86_64 : PHP FastCGI Process Manager
php70w-gd.x86_64 : A module for PHP applications for using the gd graphics library
php70w-imap.x86_64 : A module for PHP applications that use IMAP
php70w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases
php70w-intl.x86_64 : Internationalization extension for PHP applications
php70w-ldap.x86_64 : A module for PHP applications that use LDAP
php70w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php70w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php70w-mysql.x86_64 : A module for PHP applications that use MySQL databases
php70w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
php70w-odbc.x86_64 : A module for PHP applications that use ODBC databases
php70w-opcache.x86_64 : An opcode cache Zend extension
php70w-pdo.x86_64 : A database access abstraction module for PHP applications
php70w-pdo_dblib.x86_64 : MSSQL database module for PHP
php70w-pear.noarch : PHP Extension and Application Repository framework
php70w-pgsql.x86_64 : A PostgreSQL database module for PHP
php70w-phpdbg.x86_64 : Interactive PHP debugger
php70w-process.x86_64 : Modules for PHP script using system process interfaces
php70w-pspell.x86_64 : A module for PHP applications for using pspell interfaces
php70w-recode.x86_64 : A module for PHP applications for using the recode library
php70w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php70w-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php70w-tidy.x86_64 : Standard PHP module provides tidy library support
php70w-xml.x86_64 : A module for PHP applications which use XML
php70w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值