centos安装phpmyadmin
时间: 2023-11-12 16:59:42 浏览: 37
好的,以下是 centos 安装 phpmyadmin 的步骤:
1. 安装 EPEL 和 REMI 源
```
sudo yum install epel-release
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
```
2. 安装 Apache 和 PHP
```
sudo yum install httpd php php-mysql php-gd php-mbstring php-xml
```
3. 安装 phpMyAdmin
```
sudo yum install phpmyadmin
```
4. 配置 Apache
在 `/etc/httpd/conf.d/phpMyAdmin.conf` 文件中添加以下内容:
```
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
```
5. 重启 Apache
```
sudo systemctl restart httpd
```
现在你可以通过浏览器访问 `http://your_server_ip/phpmyadmin` 来使用 phpMyAdmin 了。