[redhat]RedHat安裝php72
發表於 : 2019年 7月 25日, 15:07
1. 註冊開發者帳戶, 請參考:
https://blog.gtwang.org/linux/download- ... l-website/
下載 iso 檔後, 進行安裝, 安裝方式可以參考:
https://developers.redhat.com/products/ ... tn-windows
以下為 rhel 7.6 版本為例.
2. 安裝好的 redhat 沒有 repository 可以進行安裝, 需要先啟用:
輸入開發者帳密後, 即完成註冊. 再進行 attach:
完成後, 可以利用 list 進行確認:
3. 進行 php 7.2 的安裝:
參考官方資料: https://developers.redhat.com/products/ ... #fndtn-php
啟用兩個 repository
安裝 rh-php72
其他常用php lib (其中 rh-php72-php 是會產出對應給 apache2 用的相關連結庫:
以上安裝完成 rh-php72
------------------------------------------------------
4. 安裝 apache2
將 php 7.2 連結庫掛入 apache:
(參考: https://docs.nextcloud.com/server/15/ad ... ation.html)
啟用服務
啟動服務
https://blog.gtwang.org/linux/download- ... l-website/
下載 iso 檔後, 進行安裝, 安裝方式可以參考:
https://developers.redhat.com/products/ ... tn-windows
以下為 rhel 7.6 版本為例.
2. 安裝好的 redhat 沒有 repository 可以進行安裝, 需要先啟用:
代碼: 選擇全部
# subscription-manager register
代碼: 選擇全部
# subscription-manager attach
代碼: 選擇全部
# subscription-manager list
參考官方資料: https://developers.redhat.com/products/ ... #fndtn-php
啟用兩個 repository
代碼: 選擇全部
# subscription-manager repos --enable rhel-server-rhscl-7-rpms
# subscription-manager repos --enable rhel-7-server-optional-rpms
代碼: 選擇全部
# yum install rh-php72
代碼: 選擇全部
# yum install rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl
------------------------------------------------------
4. 安裝 apache2
代碼: 選擇全部
# yum install httpd
(參考: https://docs.nextcloud.com/server/15/ad ... ation.html)
代碼: 選擇全部
# ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
# ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
# ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
代碼: 選擇全部
# systemctl enable httpd
代碼: 選擇全部
# service httpd start