yum install httpd php mariadb-server –y
搭建lamp運行環境之后安裝phpMyAdmin遇到的一些問題記錄一下
1.官網下載phpMyAdmin壓縮包
wget -c https://files.phpmyadmin.net/phpMyAdmin/4.9.3/phpMyAdmin-4.9.3-all-languages.tar.gz
2.解壓縮到/var/www/html/
tar -zxvf phpMyAdmin-4.9.3-all-languages.tar.gz -C /var/www/html/
3.重命名
cd /var/www/html/ mv phpMyAdmin-4.9.3-all-languages phpMyAdmin
到這一步一般都可以正常通過localhost/phpMyAdmin訪問了,但是有時候總會出現些其他問題,
4.進入到phpMyAdmin安裝目錄下復制phpmyadmin的簡單組態檔config.sample.inc.php,作為默認組態檔config.inc.php
復制檔案 cp config.sample.inc.php config.inc.php 編輯組態檔 vim config.inc.php 組態檔現在需要一個短語密碼,找到 $cfg['blowfish_secret'] = ''; //這里隨意添加幾個字符太短會有錯誤提示, $cfg['Servers'][$i]['auth_type'] = 'cookie'; //這里默認就好 $cfg['Servers'][$i]['host'] = 'localhost'; //這里可以改為自己的ip地址或者域名,不改也沒關系
5.如果出現錯誤提示
變數 $cfg['TempDir'] (./tmp/)無法訪問,phpMyAdmin無法快取模板檔案,所以會運行緩慢,
在phpMyAdmin目錄下新建tmp檔案夾 mkdir tmp chmod 777 tmp
6.可能會提示缺少一些擴展程式
安裝php鏈接資料庫的擴展程式包 yum install php-mysql 安裝支持多位元組字串擴展的程式包 yum install php-mbstring -y 安裝支持多加密擴展的程式包 yum install php-mcrypt –y
7.其他電腦訪問需要開啟80埠或關閉防火墻
開啟80埠 firewall-cmd --zone=public --add-port=80/tcp --permanent //--zone作用域,--add-port=80/tcp添加埠/協議,--permanent永久生效 重啟防火墻 systemctl restart firewalld 或者干脆直接關閉防火墻 查看防火墻狀態 systemctl status firewalld 停止防火墻 systemctl stop firewalld 關閉開啟啟動防火墻 systemctl disable firewalld
8.如果出現Forbidden提示沒有權限訪問,可能是被selinux阻止了
查看SELinux是否運行 getenforce 如果是 enforcing //強制模式,會限制domain/type permissive //寬容模式,會有警告但不限制domain/type disabled //關閉狀態,沒有運行 setenforce 0 //轉換成寬容模式,相當于臨時關閉SELinuxx setenforce 1 //轉換成強制模式 設定SELINUX=disables 可以設定開機不啟動 vim /etc/selinux/config
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/143891.html
標籤:Linux
