When I was searching for ideas before I came across some comments that made it sound like this issue can arise when switching from PHP4 to PHP5. Have you done that? MAMP does have that option if I remember correctly, and it enables PHP for you so you shouldn't have needed to do anything from Terminal yourself. Maybe that was an issue. Maybe there is two version running causing some confusion.