从LAN网络中的另一台PC访问Wamp 2.5 phpmyadmin

时间:2015-02-25 05:19:08

标签: phpmyadmin wamp

我可以从另一台电脑访问wamp localhost但是 从这台PC访问phpmyadmin时 我无法访问如下图

When Accessing phpmyadmin from another pc

3 个答案:

答案 0 :(得分:14)

在WAMPServer上配置phpMyAdmin工具,使其不能从运行WAMPServer的ip以外的任何ip中使用。确切地说,别名已配置好,因此只能从运行Apache的机器上访问它。

这当然是一项安全措施,以保护初学者不会意外地赠送皇冠上的宝石。

如果您想允许从其他位置(如LAN)访问phpMyAdmin,则必须修改phpMyAdmin的别名配置。您可以通过编辑

来完成此操作

\wamp\alias\phpmyadmin.conf

文件并添加说明告诉apache允许更多的ip地址连接到此别名。

Alias /phpmyadmin "d:/wamp/apps/phpmyadmin4.1.14/"

# to give access to phpmyadmin from outside 
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#

<Directory "d:/wamp/apps/phpmyadmin4.1.14/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
  <IfDefine APACHE24>
    Require local
    Require ip 192.168.10                   <-- add this line
  </IfDefine>
  <IfDefine !APACHE24>
    Order Deny,Allow
      Deny from all
      Allow from localhost ::1 127.0.0.1
      Allow from 192.168.10                 <-- add this line
    </IfDefine>
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

或者您可以通过

指定特定的IP地址
Require ip 192.168.2.100 192.168.2.101 192.168.2.102
Require ip 192.168.2.103 192.168.2.104 192.168.2.105

答案 1 :(得分:0)

Alias /phpmyadmin "D:/wamp/apps/phpmyadmin4.6.4/"

<Directory "D:/wamp/apps/phpmyadmin4.6.4/">
    Options Indexes FollowSymLinks MultiViews
  AllowOverride all
  <ifDefine APACHE24>
#       Require local
    Require all granted (changes)
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
#Deny from all
    Allow from all
#    Allow from localhost ::1 127.0.0.1
    **Allow from localhost ::0 0.0.0.0** (changes)

    </ifDefine>

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

答案 2 :(得分:0)

更改为要求所有已授予

<Directory "c:/wamp64/apps/phpmyadmin4.8.5/">
    Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
  <ifDefine APACHE24>
        Require all granted
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
    Deny from all
    Allow from localhost ::1 127.0.0.1
    </ifDefine>

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>