PHP mysql

R

richardmojo

Guest
what settings to I need for php to work on my ibook. As if i write a php file and use the mysql_connect( " ?", "?","?") statement, what should these values be.

What else needs to be done/ configure in order to host a site with database connectivity, and help wold be most appreciated as I haven't a clue really and am new to using mac's

thanks
 
Joined
Jun 11, 2003
Messages
4,915
Reaction score
68
Points
48
Location
Mount Vernon, WA
Your Mac's Specs
MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
I believe mysql default is root with no password, so you would need to update the user pass to something a bit more secure after you have everything setup.

PHP should already be setup, you just need to start web services by going to Apple -> System Preferences -> Sharing -> and start Personal Web Sharing
 
Joined
Sep 30, 2004
Messages
3,378
Reaction score
61
Points
48
PHP has to be enabled by editing the file at /etc/httpd/httpd.conf, you need to uncomment out the lines in regard to AddModule and LoadModule for php, just search PHP and you'll find it.

OS X does not come with MySQL installed, you'll have to download it.

The connect command will looks like: mysql_connect( "localhost", "username","password")

username will be root unless you want to create a new one, that is default, your password defaults to nothing so you'll probably want to change it to something.
 

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