what is the story of php with mac??

S

swan

Guest
hi
i read mac osx supported php with mysql
i dont know how i start working with php & mysql ,so i want to know the first step to test sample examples written by php .
-is there a localhost like windows?
-is there a defualt directory ?

thanks alot
 
Joined
Jun 6, 2006
Messages
1,153
Reaction score
94
Points
48
Your Mac's Specs
MacBook 2.0GHz White, 512MB RAM, 60GB HDD
Localhost does indeed exist, and points to your current machine. If you look in your home directory, you should see a directory called Sites. This is your personal web share. If you type 'http://localhost/~yourusername/' into your browser then it'll serve whatever you put in there.

I *believe* (but am willing to be corrected) that PHP is built into the Apache installation that comes with OS X and just needs turning on. I'm not at my mac right now so I can't be exact ... anyone know for sure? It may already be turned on; probably worth testing it to make sure.

MySQL installation is quite simple, if a little involved. Just grab the latest Mac OS X build from mysql.com and follow the instructions, remembering to switch to root in the terminal before carrying out any of the commands.
 
Joined
Sep 30, 2004
Messages
3,378
Reaction score
61
Points
48
http://localhost/ will take you to /Library/WebServer/Documents/, assuming you have apache turned on.

Enabling PHP if you have 10.4 is as easy as going to /etc/httpd/httpd.conf and un-commenting out the lines that mention php.
 
Joined
Sep 22, 2005
Messages
206
Reaction score
24
Points
18
Location
Las Vegas, NV
Your Mac's Specs
13" MacBook Pro
patpat said:
Or you can try the XAMPP for Mac OS X. It's basically an Apache package filled with MySQL, PHP and Perl. The installation is relatively easy.

Regards,
Pat

This would definitely be my recommendation. The PHP installation has pretty much every option enabled, so there is very little work needed to get your local scripts up and running.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top