[精讚] [會員登入]
5034

[Centos8] 安裝phpMyAdmin

Centos 8目前只能採用tarball安裝法

分享此文連結 //n.sfs.tw/14380

分享連結 [Centos8] 安裝phpMyAdmin@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2020-06-30 15:48:42 最後編修
2020-01-14 11:47:08 By 張○○
 

自動目錄

Centos 8目前只能採用tarball的安裝法。

OS

CentOS Linux release 8.0.1905 (Core)

PHP 7.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

mysql  Ver 15.1 Distrib 10.3.11-MariaDB, for Linux (x86_64) using readline 5.1

必要條件

PHP >=7,Mysql/ Mariadb 已安裝,防火牆80埠有開

安裝

安裝php相關組件

# yum install php php-pdo php-pecl-zip php-json php-common php-fpm php-mbstring php-cli php-mysqlnd

下載phpmyadmin tarball

下載頁面 https://www.phpmyadmin.net/downloads/

例如到你的安裝目錄下

解壓

# unzip phpMyAdmin-5.0.1-all-languages.zip

更名

# mv phpMyAdmin-5.0.1-all-languages phpMyAdmin

修改 phpMyAdmin 設定檔

需要把 config.sample.inc.php 複製成 config.inc.php,到 phpMyAdmin的目錄下

# cp config.sample.inc.php config.inc.php

修改設定檔

# vi config.inc.php

填入bluefish的key,不能留空白,請開啟以下網頁取得 Bluefish 的 key,每次開啟得到的key都不同,選自己喜歡的貼上

https://phpsolved.com/phpmyadmin-blowfish-secret-generator/

如果有需要微調的情況,可修改設定檔

安裝完成並登入

限定讀取來源

# vi /var/www/html/phpMyAdmin/.htaccess

#Block users by IP 限定以下ip才能存取
order allow,deny
deny from All
allow from 163.17.X.0/24
allow from 2001:288:5400::/64
allow from  211.75.X.X

#Prevent directory listings 禁止列出目錄
Options All -Indexes

重啟 apache 生效

# systemctl restart httpd

開啟網頁 http://x.x.x.x/phpmyadmin  <== 上面設的別名

selinux

# setsebool httpd_can_network_connect_db on

 

祝您使用愉快

錯誤排除

1. Fatal error: Uncaught Error: Call to a member function getCookie() on null in /var/www/html/phpMyAdm/libraries/classes/Url.php:217

解決方法:上面的getCookie()也許是別的函數,主因是少裝了部分套件,例如 php-pdo php-pecl-zip php-json

2. 畫面一片白沒有錯誤

少裝了什麼套件,請檢查一下 例如 php-json

3. 網頁顯示

Forbidden

You don't have permission to access /phpMyAdm/ on this server.

因為你的.htaccess沒指定能用的ip

參考資料

[1] https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-phpmyadmin-on-rhel-8.html

END

你可能感興趣的文章

dnf 一個即將取代 yum的套件管理程式 centos 系統中老牌的套件管理程式yum,也許未來將被dnf所取代

[CENTOS7 8] 查看記憶體 linux 中查看記憶體狀態指令整理

[MSSQL] 使用linux連接微軟的MS-SQL 職務上需要連接到mssql,這是我第一次試圖在linux連接mssql。

DNS壓力測試工具queryperf 要怎麼知道我安裝的DNS是否能耐受的住網路上的攻擊或大量查詢,這裡有一個免費的工具 queryperf

[CentOS8] 1.安裝JULIA 安裝及開始使用 JULIA

[Centos7] 把帳號新增移除具有root權限等級的sudoer 把帳號新增或移除具有root權限等級的sudoer

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

SELinux 常用指令和檔案 在Redhat系列中,Centos5以後加入了selinux,他並沒有這麼可怕,不必每次看到Selinux ,就想把他

[bc] linux 的計算機 bc 設定小數位數、計算π、次方根 linux 的計算機 bc 設定小數位數、計算π、次方根

世紀帝國征服者新版本--被遺忘的帝國 世紀帝國征服者新版本--被遺忘的帝國 世紀二代的征服者是精典遊戲中的精典,aofe更好玩...

在Centos7 下安裝 Wildfly10 wildfly以前叫JBoss,2014.11.20改名叫Wildfly,起始版本是Wildfly8,現在已經出到Wil

[Centos6] 安裝wordpress Centos 6下安裝wordpress,非常簡單