PHP + OSX

David Gluzman January 10th, 2007

Disclaimer.. This is going to be absolute rhetoric for anyone that isn’t developing websites.

So. OSX comes pre-packaged with PHP/Apache, this isn’t exactly news… However… After many hours toiling away here trying to get my MAMP (Mac, Apache, MySql, PHP) distro running and hitting my head against the wall..

Wait.. Let me explain.. Getting my dev box running the site(s) wasn’t an issue.. It was getting the automated scripts running in terminal that was driving me crazy. Shit was plain up not working. Skip the drama, but PHP4 will take precendance in the OSX pathing regardless of any other distros you may have path’d.

Solution:

cd /usr/bin
sudo mv php php.old

THEN!

cd into your local folder, ie: /Users/username (or just type cd)

edit your .profile and add the following anywhere:

export PATH=$PATH:/Applications/MAMP/bin/php5/bin/

Next restart your terminal session, and then type php -v. You should hopefully be running your own distro rather than the forsaken osx php4 cause of all nightmares version.

That’s all…

  • I don’t know if rhetoric is the right word – more like gibberish.

  • D4V

    GAH!.. Somehow my old php executable came back to life.. Screwin up lots of stuff! $%*@$)(@#

    Thankfully I wrote about this as reference to fix it again. *sigh*

  • D4V

    for later reference:

    If install mamp pro 1.7 add to the .profile:

    export DYLD_LIBRARY_PATH=/Applications/MAMP/Library/lib:${DYLD_LIBRARY_PATH}

    ..exactly how that is. :)