Enable PHP on a MAC

I realize this is NOT a PHP forum and if somebody knows a better place to post (with the exception of where the sun don’t shine), please let me know.

The following code has been slightly modified (I removed parenthesis from the first line that produced an error with bash that contained the do shell script) from the MAC website http://developer.apple.com/mac/articles/internet/phpeasyway.html and I have not had any luck enabling PHP on my system. Any ideas? Bash produces an error message saying “-bash: s^you@example.com^$admin_email^: No such file or directory” I am not sure what to use in place of the placeholder “you@example.com”. I’ve used my e-mail address that is entered in the AddressBookMe.plist (/library/preferences/) under ExistingEmailAddress and still no luck.

set admin_email to do shell script “defaults read AddressBookMe ExistingEmailAddress”

NOTE: Having a writeable database in your home directory can be a security risk!

conf=apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'

touch $user_db
chmod a+r $user_index
chmod a+w $user_db
chmod a+w $user_www

echo “Enabling PHP in $conf …”
sed ‘/#LoadModule php5_module/s/#LoadModule/LoadModule/’ $conf | sed
‘s^you@example.com^$admin_email^’ > $conf_new

echo “(Re)Starting Apache …”
osascript <<EOF

Model: MacBook
Browser: Firefox 3.0.5
Operating System: Mac OS X (10.5)

The following site http://foundationphp.com/tutorials/php_leopard.php had a solution that worked. PHP is now up and running.:smiley:

For future reference, here are a couple of places you can get PHP help: