小編給大家分享一下CentOS7怎么使用yum安裝PHP7.3,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
華龍網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)公司!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、成都響應(yīng)式網(wǎng)站建設(shè)公司等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。創(chuàng)新互聯(lián)公司成立與2013年到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)公司。
CentOS 7 yum安裝 PHP7.3 教程
1、首先安裝 EPEL 源:
yum install epel-release
安裝 REMI 源:
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
2、安裝 Yum 源管理工具:
yum install yum-utils
3、安裝 PHP7.3:
yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-MySQLnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xmll
安裝完成后最好重啟一下計(jì)算機(jī),不然有可能無法啟動(dòng)php
設(shè)置開機(jī)啟動(dòng)、運(yùn)行服務(wù):
systemctl enable php73-php-fpm systemctl start php73-php-fpm
設(shè)置 PHP
查找安裝包:
[root@xxx etc]# rpm -qa | grep 'php'php73-php-cli-7.3.6-1.el7.remi.x86_64 php73-php-mbstring-7.3.6-1.el7.remi.x86_64 php73-php-pecl-mcrypt-1.0.2-1.el7.remi.x86_64 php73-runtime-2.0-1.el7.remi.x86_64 php73-php-pdo-7.3.6-1.el7.remi.x86_64 php73-php-bcmath-7.3.6-1.el7.remi.x86_64 php73-php-fpm-7.3.6-1.el7.remi.x86_64 php73-php-mysqlnd-7.3.6-1.el7.remi.x86_64 php73-php-snmp-7.3.6-1.el7.remi.x86_64 php73-php-gd-7.3.6-1.el7.remi.x86_64 php73-php-json-7.3.6-1.el7.remi.x86_64 php73-php-soap-7.3.6-1.el7.remi.x86_64 php73-php-recode-7.3.6-1.el7.remi.x86_64 php73-php-pecl-crypto-0.3.1-5.el7.remi.x86_64 php73-php-common-7.3.6-1.el7.remi.x86_64 php73-php-opcache-7.3.6-1.el7.remi.x86_64 php73-php-pecl-geoip-1.1.1-6.el7.remi.x86_64
找到:php73-php-fpm-7.3.6-1.el7.remi.x86_64安裝位置
[root@xxx etc]# rpm -ql php73-php-fpm-7.3.6-1.el7.remi.x86_64 /etc/logrotate.d/php73-php-fpm /etc/opt/remi/php73/php-fpm.conf /etc/opt/remi/php73/php-fpm.d /etc/opt/remi/php73/php-fpm.d/www.conf /etc/opt/remi/php73/sysconfig/php-fpm /etc/systemd/system/php73-php-fpm.service.d /opt/remi/php73/root/usr/sbin/php-fpm /opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6 /opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6/php-fpm.conf.default /opt/remi/php73/root/usr/share/doc/php73-php-fpm-7.3.6/www.conf.default /opt/remi/php73/root/usr/share/fpm /opt/remi/php73/root/usr/share/fpm/status.html /opt/remi/php73/root/usr/share/licenses/php73-php-fpm-7.3.6 /opt/remi/php73/root/usr/share/licenses/php73-php-fpm-7.3.6/fpm_LICENSE /opt/remi/php73/root/usr/share/man/man8/php-fpm.8.gz /usr/lib/systemd/system/php73-php-fpm.service /var/opt/remi/php73/lib/php/opcache /var/opt/remi/php73/lib/php/session /var/opt/remi/php73/lib/php/wsdlcache /var/opt/remi/php73/log/php-fpm /var/opt/remi/php73/run/php-fpm
查找php.ini位置:
[root@xxx etc]# find /etc/opt/remi/php73 -name php.ini/etc/opt/remi/php73/php.ini
編輯/etc/opt/remi/php73/php.ini替換換 ;cgi.fix_pathinfo=1 為 cgi.fix_pathinfo=0 快捷命令:
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini
重啟php73-php-fpm
systemctl restart php73-php-fpm
更多操作:
systemctl restart php73-php-fpm #重啟 systemctl start php73-php-fpm #啟動(dòng) systemctl stop php73-php-fpm #關(guān)閉 systemctl status php73-php-fpm #檢查狀態(tài)
查看 PHP
驗(yàn)證一下是否安裝成功:
root@mf88.biz-service:~# php73 -v PHP 7.3.0-1+(cli) (built: Dec 6 2018 20:24:55) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.0-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
更新 PHP
運(yùn)行下面的命令系統(tǒng)就會(huì)更新所有可以更新的軟件包括 PHP
yum update
安裝更多組件
上面的一條命令安裝 PHP 只是安裝了部分 PHP 拓展,更多的軟件可見:
# yum search php73 Updating Subscription Management repositories. Last metadata expiration check: 0:27:54 ago on Wed 15 May 2019 10:39:52 AM EDT. ============================================================================================= Name Exactly Matched: php73 ============================================================================================== php73.x86_64 : Package that installs PHP 7.3 php73.x86_64 : Package that installs PHP 7.3 ============================================================================================ Name & Summary Matched: php73 ============================================================================================= php73-syspaths.x86_64 : System-wide wrappers for the php73 package php73-syspaths.x86_64 : System-wide wrappers for the php73 package php73-scldevel.x86_64 : Package shipping development files for php73 php73-scldevel.x86_64 : Package shipping development files for php73 php73-php-zstd-devel.x86_64 : php73-php-zstd developer files (header) php73-runtime.x86_64 : Package that handles php73 Software Collection. php73-runtime.x86_64 : Package that handles php73 Software Collection. php73-runtime.x86_64 : Package that handles php73 Software Collection. php73-php-pecl-psr-devel.x86_64 : php73-php-pecl-psr developer files (header) php73-php-pecl-psr-devel.x86_64 : php73-php-pecl-psr developer files (header) php73-php-pecl-raphf-devel.x86_64 : php73-php-pecl-raphf developer files (header) php73-php-pecl-raphf-devel.x86_64 : php73-php-pecl-raphf developer files (header) php73-php-pecl-propro-devel.x86_64 : php73-php-pecl-propro developer files (header) php73-php-pecl-yaconf-devel.x86_64 : php73-php-pecl-yaconf developer files (header) php73-php-pecl-propro-devel.x86_64 : php73-php-pecl-propro developer files (header) php73-php-pecl-yaconf-devel.x86_64 : php73-php-pecl-yaconf developer files (header) php73-php-pecl-xmldiff-devel.x86_64 : php73-php-pecl-xmldiff developer files (header) php73-php-pecl-swoole4-devel.x86_64 : php73-php-pecl-swoole4 developer files (header) php73-php-pecl-xmldiff-devel.x86_64 : php73-php-pecl-xmldiff developer files (header) php73-php-zephir-parser-devel.x86_64 : php73-php-zephir-parser developer files (headers) php73-php-zephir-parser-devel.x86_64 : php73-php-zephir-parser developer files (headers) php73-php-pecl-handlebars-devel.x86_64 : php73-php-pecl-handlebars developer files (header) ================================================================================================= Name Matched: php73 ================================================================================================== php73-php.x86_64 : PHP scripting language for creating dynamic web sites php73-php.x86_64 : PHP scripting language for creating dynamic web sites php73-build.x86_64 : Package shipping basic build configuration ……
以上是“CentOS7怎么使用yum安裝PHP7.3”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
新聞名稱:CentOS7怎么使用yum安裝PHP7.3
鏈接分享:http://www.rwnh.cn/article36/jdcisg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、搜索引擎優(yōu)化、網(wǎng)站排名、動(dòng)態(tài)網(wǎng)站、定制開發(fā)、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)