DEV Community

Cover image for CentOS 7 裝 Adminer
Leon
Leon

Posted on • Originally published at editor.leonh.space

CentOS 7 裝 Adminer

Adminer 很簡單,它只是一個 php 檔案,抓回來放到 web server 目錄下就好:

$ cd /usr/share/nginx/html/
$ wget https://www.adminer.org/latest.php
$ mv latest.php adminer.php
Enter fullscreen mode Exit fullscreen mode

可是事情果然沒那麼簡單!這樣跑下去它會報錯,找不到 PHP 連接 MariaDB 的庫。

又再次因為我是裝 CentOS Software Collections 的 PHP,所以額外的套件也都要裝 SCL 提供的,把必要的套件裝起來:

$ sudo yum install rh-php72-php-mysqlnd
Enter fullscreen mode Exit fullscreen mode

還沒完,/var/opt/rh/rh-php72/lib/php/ 這個地方裡面的子目錄,群組都被設成 apache,可是因為我是用 nginx,要把群組改成 nginx 才可讓 nginx 有能力寫入這些子目錄。

以上做完當然試開一下瀏覽器看看 Adminer 有沒有正常跑起來。

Top comments (0)