Terminal $PATH error
The error message you listed is the result of using one of

 export $VARIABLE
 export /a/path/to/something
 export *more or less anything which is not a syntactically correct variable name*


instead of

 export VARIABLE


in one of your initialization files. To find the offending line you need to look into all the .profile, .bash_profile and anything sourced/called from there and grep for 'export ' to find it.

As it seams to be related to the installation of either PEAR or MAMP I would start looking at any additions done by these installations.