Setting up PHP on my Mac

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
woodybepierced
Forum Newbie
Posts: 1
Joined: Thu Nov 16, 2006 10:25 pm

Setting up PHP on my Mac

Post by woodybepierced »

Yes, NEWBIE WARNING!

K, I dont know where I fell off the bus, but I got nothing. I am on a G5 running OSX 10.3.9 and I am trying to learn me some PHP. Well, I know that mac's come with some form of a local sever already on them, but I have to do some setting up for PHP and mySQL... I have read some sites, downloaded some files and still to no aval, got myself no closer to figuring out where I am going wrong and what I need to do to begin understanding the "setup process" for this! So, please, no jokes, if you would please either point me in the correct directions, things I may have missed, a install PHP for dummies pictorial.. you know what im saying!

Thanx,
woody!
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

I haven't done this on a Mac in a loooooooooooooooooong time. Yup Apache is preinstalled on Macs. You'll need to compile PHP from source and install MySQL. But if you grow tired of that I recall there being a third party installer for PHP/MySQL for macs -- PhpStar ...!?! dunno.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

http://www.mamp.info/en/index.php. Works perfect. One click install and you have php4, 5, mysql, phpmyadmin, etc.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

matthijs wrote:http://www.mamp.info/en/index.php. Works perfect. One click install and you have php4, 5, mysql, phpmyadmin, etc.
I never got Mampp working. It always refused to start apache. Easy(ish) way:

1. Download MySQL-Max binary edition for OS X, Installing this is easy since it's GUI-based
2. Download Apache2 (source code) and extract it
3. Go to apache2 source folder and run command:

Code: Select all

-$    ./configure --prefix=/usr/local/apache2 --enable-mods=ALL
-$    make && make install
4. Test the installation of apache by running "sudo /usr/local/apache2/bin/apachectl start" then view "localhost" in your browser
5. Download PHP source code and extract it
6. Go to PHP source directory and run:

Code: Select all

-$    ./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs
-$    make && make install
7. Open /usr/local/apache2/conf/httpd.conf and add the line:

Code: Select all

AddType application/x-httpd-php .php
8. Start MySQL by running /usr/local/mysql/bin/mysqld_safe&
9. Restart apache

Code: Select all

-$    /usr/local/apache2/bin/apachectl stop
-$   /usr/local/apache2/bin/apachectl start
Done.

(Actually i never thought about just how many steps there are there. Basically just compile from source in the order MySQL, Apache, PHP. Place everything in /usr/local/<app> because it's easier to get rid of this way).
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Also, take a look at http://www.phpmac.com/
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Well installing on MacBook and MacBook Pro both were without problems. But your explanation doesn't look too difficult. If it's really only these steps it's easy(ish). I have read much much longer tutorials explaining the installation process. Not being familiar with the command line (yet) I always found that a bit intimidating. But maybe that is a gut feeling remaining from my windows experience. Anything that can potentially screw up the system will... :)

(maybe I'll try a manual install with your explanation as well)
Post Reply