Wednesday, December 23, 2009

Saturday, December 5, 2009

PHPMyAdmin: Setting up the MAMP environment

Continuing notes to self. Followed the PHPMyAdmin macports installation instructions here.

I couldn't get logged in to PHPMyAdmin. When I tried to log in I got the message "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)"

I googled the error and found this helpful thread in the MySQL forums. Amusingly, I found that I had previously had the same problem and thanked the poster almost exactly a year ago for the solution. Memory is short and technology is a long bizarre road.

yes- this works for me. You just have to go into the config.inc.php file and change:
$cfg['Servers'][$i]['host'] = 'localhost';

to this

$cfg['Servers'][$i]['host'] = '127.0.0.1';

Configuring my new MacBook Pro for development

I'm setting up my new —well, used, thanks JB!— MacBook Pro with Snow Leopard for development. I'm using MacPorts for simplicity, but of course, one always runs into something that baffles and confounds.

For future reference and benefit as I struggle through this:

Setting up the MAMP environment for Apache


  1. Don't forget to install XCode before installing MacPorts.
  2. This MacPorts guide is a good starting point.
  3. My first struggle was to get the right Apache launching, NOT the built-in Mac version.
  4. Make sure that the "web sharing" is off in System Preferences. This should be done before installing the apache2 macport.
  5. To check if you're running the right httpd (Apache daemon process) in terminal:
    ps -ax | grep httpd
    you want to see /opt/local/apache2/bin/httpd

    you don't want to see /private/etc/apache2
  6. To get apachectl commands working in terminal, I couldn't get the alias working, I had to add the path to .profile like this:
    export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:$PATH
    That includes the paths that MacPorts wrote.
  7. To see if you're going to execute the right apachectl, use this command in terminal:
    which apachectl
    and you'll see which one is first in line to execute. Very handy little command.
  8. I couldn't get my virtual hosts working until I edited /private/etc/hosts to assign them to 127.0.0.1 as described here. It wasn't enough to configure vhosts or my username.conf file and include it in httpd.conf.