Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

phillipjfry

macrumors 6502a
Original poster
I'm new to the whole thing. I have started up apache, enabled php in the httpd.conf file. I also installed the precompiled mysql image. After testing out a page with a <?php phpinfo() ?> I noticed in the "Configure Command" it has
'--with-mysql=/usr'

The precompiled image of MySQL installed at /usr/local/mysql
my $PATH's are setup correctly. So my question: is everything setup correctly? 😕
 
How about you test it to make sure it works. Make a php program that creates a simple database, inserts a couple records, and then queries those records. Sure it's the long way but also the fun way. 🙂
 
hehe, i am trying, I haven't learned far enough as to how to get php to query mysql for information 🙂
Sometimes I ask for an easy way out because of frustration, this is one of those times 🙂


Edit: Ok, I tried a small script that php tries to access mysql.

I ran it and I got this error

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Users/username/Sites/test.php on line 2

I don't have a mysql.sock file on my system anywhere, especially in /var/mysql/
I've tried installing mysql all day today, using different sources each time (since i suspected it wasn't installing right). Thanks in advance 🙂

Edit2: Ok it looks like I got everything setup the way it should be. I ended up just dumping the whole /usr/local/mysql folder, installing MAMP and fiddling with those config files (to get them to point to /User/username/Sites folder; and no, changing the DocumentRoot in the GUI settings does NOT work for some reason). Now I just have to learn how to code 😛
 
If you learn well from books, pick up Web Database Applications with PHP and MySQL, it's an O'Reilly book. It helped me tons.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.