這篇文章主要介紹在CentOS / RHEL 6.10上安裝PHP的方法,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
站在用戶的角度思考問題,與客戶深入溝通,找到江華網(wǎng)站設(shè)計(jì)與江華網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名與空間、虛擬主機(jī)、企業(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存儲(chǔ)庫。使用以下命令在CentOS和Red Hat 7/6系統(tǒng)上安裝EPEL存儲(chǔ)庫
使用此命令安裝epel-release yum存儲(chǔ)庫
# yum install epel-release
現(xiàn)在根據(jù)你的操作系統(tǒng)版本執(zhí)行以下命令之一來安裝Remi 存儲(chǔ)庫。
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
在CentOS 6上安裝PHP 7
你的系統(tǒng)已經(jīng)為從yum存儲(chǔ)庫安裝PHP做好了準(zhǔn)備。根據(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?,F(xiàn)在運(yùn)行以下命令來檢查系統(tǒng)的當(dā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
你可以運(yùn)行以下命令,在已配置的yum存儲(chǔ)庫下搜索其他可用的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)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!