开发者

Access phpmyadmin over lan using mamp

开发者 https://www.devze.com 2023-01-20 12:06 出处:网络
We are trying 开发者_JAVA技巧to set up a Mamp Pro installation ( on Mac ) which allows us to access PhPmyAdmin over the lan. We can access the htdocs folder to edit it\'s contents using standard shari

We are trying 开发者_JAVA技巧to set up a Mamp Pro installation ( on Mac ) which allows us to access PhPmyAdmin over the lan. We can access the htdocs folder to edit it's contents using standard sharing so that is not a problem.

The problem is that we can't seem to the access the PhPmyAdmin of this installation. I've googled for several hours trying to make this work and now I'm trying here.

I found several cases where they explain that you can access your phpMyAdmin via this:

http://ip-ofserver:8888/MAMP

but this is not working and I get this error:

Forbidden You don't have permission to access /MAMP on this server.

Accessing the servers content itself is working. I'm getting the test webpage provided with the clean installation of mamp pro.

Setup

Internet -> Airport Extreme provides LAN

3 hosts are connected to the Lan and one is a mac mini with the Lamp installation on it.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号