Access phpmyadmin over lan using mamp

别说谁变了你拦得住时间么 提交于 2019-12-05 16:15:56

I didn't find the correct answer, but I found a work around, just copy MAMP/bin/phpMyAdmin directory to under MAMP/htdocs/

Rename the folder, in my case I have it MAMP/htdocs/dba Then you simply do: http://(dev-machine-ip)/dba

Replace (dev-machine-ip) with the IP of your dev machine where MAMP is installed. The reason to change the folder name is because there is a configuration in httpd.conf that redirect /phpMyAdmin to a different physical folder. Of course you can also just remove that directive, up to you.

I have managed to solve this problem with MAMP Pro by adding my local ip range address to the http.conf file.

i complete this by going to (from MAMP Pro window) file > Edit Template > Apache > http.conf scrolling to about line 399 there was the block of text

    Alias /phpMyAdmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
    Alias /phpmyadmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"

    <Directory "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin">
        Options Indexes
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
        Allow from 127.0.0.1
        Allow from ::1
    </Directory>

and editing to to allow my local IP (which is 192.168.2.xxx)

    Alias /phpMyAdmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"
    Alias /phpmyadmin "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin"

    <Directory "/Library/Application Support/appsolute/MAMP PRO/phpMyAdmin">
        Options Indexes
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from localhost
        Allow from 127.0.0.1
        Allow from ::1
#Adding in new rule to allow local IPs to access, leave the last number blank to allow all in that range
        Allow from 192.168.2
    </Directory>

Restarted the server and was able to access phpmyadmin from another computer on our network by entering http://[HostComputerIP]:8888/phpMyAdmin

John Talbert

I had this problem and it turned out to be a .htaccess file installed for another application that was being applied to phpMyAdmin too.

.htaccess files hold apache directives for the specific folder where it lives and all sub folders within that folder. These directives are the same ones that normally would live in the /etc/apache2/httpd.conf file except for the fact that they are being singled out for a specific directory of web files.

Solutions: 1. Use BBedit to edit the /etc/apache2/httpd.conf file. Change AllowOverride All to AllowOverride None. However, this will cause Apache to ignore all .htaccess files. 2. Create a section in /etc/apache2/httpd.conf using <Directory … > and move all the directives from the offending .htaccess to that section. Use <Directory> to be specific which Directory the directives are applied to. Then erase the .htaccess file. 3. If you can, move the offending .htaccess file down the file structure to where it's actually needed.

Note that .htaccess is a hidden file on the Mac. Look up what tools are available to make hidden files visible so you can work on them, like BBedit and the Pref Pane Secrets.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!