在CentOS/RHEL6.10上安裝PHP的方法

這篇文章主要介紹在CentOS / RHEL 6.10上安裝PHP的方法,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

站在用戶的角度思考問題,與客戶深入溝通,找到江華網(wǎng)站設(shè)計與江華網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:成都網(wǎng)站設(shè)計、成都做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、域名與空間、虛擬主機、企業(yè)郵箱。業(yè)務(wù)覆蓋江華地區(qū)。

 PHP 7.3是PHP最新的穩(wěn)定版本。本文將給大家介紹如何在CentOS和Redhat 6.10系統(tǒng)上安裝PHP 7.3、PHP 7.2、PHP 7.1。

配置yum庫

首先,需要在系統(tǒng)上啟用Remi和EPEL yum存儲庫。使用以下命令在CentOS和Red Hat 7/6系統(tǒng)上安裝EPEL存儲庫

使用此命令安裝epel-release yum存儲庫

# yum install epel-release

現(xiàn)在根據(jù)你的操作系統(tǒng)版本執(zhí)行以下命令之一來安裝Remi 存儲庫。

$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

在CentOS 6上安裝PHP 7

你的系統(tǒng)已經(jīng)為從yum存儲庫安裝PHP做好了準備。根據(jù)需要,使用以下命令之一在系統(tǒng)上安裝PHP 7.3或PHP 7.2或PHP 7.1。

## 安裝PHP 7.3 
$ yum --enablerepo=remi-php73 install php

## 安裝PHP 7.2 
$ yum --enablerepo=remi-php72 install php

## 安裝PHP 7.1 
$ yum --enablerepo=remi-php71 install php

我已經(jīng)在我的系統(tǒng)上安裝了最新版本的PHP 7.3。現(xiàn)在運行以下命令來檢查系統(tǒng)的當前使用的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模塊

你還可能需要根據(jù)你的應(yīng)用程序需求安裝額外的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

以上是在CentOS / RHEL 6.10上安裝PHP的方法的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

新聞標題:在CentOS/RHEL6.10上安裝PHP的方法
網(wǎng)站網(wǎng)址:http://muchs.cn/article28/gessjp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機網(wǎng)站建設(shè)、服務(wù)器托管做網(wǎng)站、網(wǎng)站策劃外貿(mào)建站、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)