Support » Localhost Installs » WP and Mamp

  • Hi, sorry if this has been asked but I cant find it with the exact environment I am running. Its as follows:

    Until now I had been doing WP and MAMP dev on 1 machine alone. No problems there. A friend is now going to be working on the same site as me and So he borught his imac, same as mine, and I bought a server mini so that we can both work off the same directory.

    To move everything from my single user environment to the server where we can coloborate, do I need to upgrade to MAMP Pro? I have tried to run everything with regular mamp and am having some problems. Here is what was done.

    Enabled file sharing and web services on mac server. Installed MAMP free. Moved entire DB folder from single user machine to db folder on server MAMP. Moved working file directory and pointed apache to it. Verfied all DB files tables and actual dbs themselves show up in myphpadmin, everything looks fine including user name et cetera.

    Getting :error establishing a database connection” when I try to enter a website page from the MAMP localhost:8888 index page.

    All my wp cfg files still use root/root “db_name” and localhost for the 4 main DB parameters.

    So 1 how do I fix this and how should I best structure the working dirs. to use this way? Should I put everything in the server OS server webpages library, or create a new webpage. Create a new webpage requires a domain name and wont accept a file path. All kinds of problems with this. Would MAMP Pro just make this a breeze? Thanks in advance.

Viewing 15 replies - 1 through 15 (of 16 total)
  • MAMP Pro can do it with some configuring.

    Or you could try out Bitnami ( which provides pre-built stacks for local or server installation.

    Either way, you’re going to want to read-up on how to set up, configure, secure and run a server which goes way beyond WordPress support.

    Thanks for the reply. I am giving the stack a try but its a little different than the standard MAMP. For instance there is only the option to start/stop apache and sql as opposed to also setting the working directory which allows you to open localhost for an index of all sites. I suppose this now puts you in the realm of manually editinf conf files to set that kind of thing up?

    I think the Mac Server OS interferes with the Mamp stack. To server pages server has to be on, but once server is on the apache in server takes over the localhost? What is the solution? Virtual hosts?

    Wait, if you’re running Mac OS X Server, why bother with MAMP or Bitnami? Just install MySQL and work with the already existing Apache and PHP that comes pre-installed with Mac OS X.

    If you plan on serving more than one site off of the server, yes, you will need to work with Virtual Hosts. The other key bit is port forwarding and configuring your router.

    Like I said earlier, this is moving way beyond WordPress support and is more about server configuration and management. I’d suggest hitting up an appropriate forum for this kind of information.

    OK, I appreciate the feedback. The idea was that the other user is very tech green and needed the most simple implementation possible therefore MAMP+Wordpress.

    Wait, I’d like to clear 1 thing up. I don’t want to host any sites. This is purely for local collaboration during development.

    Ah… Okay. Then MAMP pro should do everything you need but you’ll still need some “extra” configuration to be able to access the sites over the local network (MAMP pro can handle the virtual hosts). See for a possible solution.

    I had actually come across that blog but didn’t like the need for the proxy. This just seemed to me like it could work very simply. I am very close to having this work now with the following set up.

    Install Mamp on all computers, 2 imacs and 1 server.
    Put all files on server and share
    Map MAMP apache to the same share folder on server

    Opening each site’s wordpress will allow me to edit them from each computer in collaboration form. The trouble comes in when the MySQL is not shared. Each imac has its own MySQL and unlike the apache files, I don’t think the DB can be shared in the way a file is shared? I would have to replace the “db” folder with a link to a network shortcut named “db” but I don’t think that would work.
    Another problem point is there are links being generated by WP with the “localhost/” in the file path. These links break when viewed remotely via a browser pointing to the server IP.

    I don’t even really need virtual hosts for each site. It is fine if I can get just an index page with a list of all the sites by going to the server IP address.

    Huh. I think your solution overcomplicates the matter though. You don’t need three servers (which is what MAMP is). You need one central server that two development machines have access to the htdocs folder to edit files on, no?

    That is correct.

    So with 1 MAMP running, how do the MYSQL files get worked on, all via the WP admin for each site only?

    Here is an example of why I couldnt get it to work with the 1 MAMP on the server setup. If I open the index list and go to a site, the images are gone, and when I check the image link it is something like this:


    So is WP grabbing some kind of improperly set variable that resolves to “localhost” ? How do I fix this one thing? If I can do that then I think everything will work as I need it to,

    Thanks again.

    Did you configure the WordPress install correctly? So the site url should be (based on the image path you provided):


    if that’s correct, the image paths should be fine. That being said, this URL is not accessible to other devices until you edit the hosts file on those devices to map the address to that server IP/folder.

    So it’s a bit like configuring virtual hosts but on each machine that wants to connect to this server and see these sites. Look into GasMask, a free hosts file editing and management app. At least I think that’s what you’ll need to do.

    I think you are right. I didnt even think of adding localhost in the hosts file to point to the server as clearly that is bad practice in general. But I think in this case it would be a harmless workaround. I appreciate the responses.

    Take a look at Gas Mask – it’s a small lightweight app for managing a Mac’s hosts file. Like it can save completely new versions of a hosts file and you can select which version you want to use, thus preserving the original hosts file. Do note you may have to flush your DNS cache after changing hosts files for it to take effect.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘WP and Mamp’ is closed to new replies.