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

Brother Michael

macrumors 6502a
Original poster
Apr 14, 2004
717
0
Hey all, just having some PHP and MySQL issues that I can't seem to figure out.

I wanted to start learning these two items in Website Development and so I set out to tonight.

Here's the problems:

I did not know that 10.3 had PHP and MySQL already on it. So I downloaded new versions designed for OS X (in other words I didn't download the binaries and compile them)

I installed them and didn't get any troubles from them at first. I continued to follow the directions that came with MySQL and nothing worked the way the directions stated it should.

I downloaded MySQL 4.0.3 (I think, I know it was 4.0 because I had to follow some different directions) and PHP 5.0

Having thought that the directions were wrong I proceded to Apple.com for some help. I found it, but I think it was for Jaguar in hind site...As my computer had a "mysql" user.

Basically I think I hosed my servers. I have directories all over the place that I do not recognize being there before, I have two different MySQL servers, a simple PHP script that I typed up didn't work at all (all it was supposed to do was print "hello world!"), and it seems like when I try to load anything on PHP or MySQL from the command line the computer just sorta hangs there.

If anyone understands that at all and give me some advice it would greatly help, as I am about to just format the whole thing and start over fresh.

Mike
 
Can't you just remove the php you installed and that? Or revert back or something? Next time you install php try to see if it works first by doing this. In a filename.php (change filename to whatever you want) put in this code
<?php
echo "PHP is running just fine.";
?>

That will print

PHP is running just fine.

With mysql I dunno how to really help there (until I have a mac to experiment on). So yeah... look for docs on the internet.
 
I am having a similar problem. I can not get php to work on my mac. I found an <a href="http://www.macgeekery.com/node/8">article</a> on mac geekery that stated that I had to turn it on in an apache config file. However I search my entire harddrive and never found the file. I gave up and now just upload everything I type to my server to test it, it's a slow and annoying process but it works.
 
one problem at a time...

first, php.

the file is:
/etc/httpd/httpd.conf


back it up, edit it (i use Terminal and vi), and uncomment these lines:
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c


you'll have to be superuser to do that. now, stop and restart your webserver (System Preferences / Sharing is an easy way to do that) and try opening the php file suggested above.
 
btw, i don't know if you meant "learning" php and mysql to include installing them. in these days of cheap webhosting (PM me if you want me to point you to my hosting company, which offers php and mysql preconfigured), it might make sense to let someone else take care of the config so you're free to learn the programming.
 
zimv20 said:
btw, i don't know if you meant "learning" php and mysql to include installing them. in these days of cheap webhosting (PM me if you want me to point you to my hosting company, which offers php and mysql preconfigured), it might make sense to let someone else take care of the config so you're free to learn the programming.

I am beginning to agree with you. I think I may jsut do that and/or use a Linux server that I do not care how many times I format it if it messes up. I won't do this to my Mac again until it becomes a little more idiot proof for things like that.

Mike
 
Do you guys have Apache installed? Cause thats kind of the main component for installing anything like that. I'm not sure what Mac offers on its OS or that, but I'm guessing that you have to manually download and install Apache.
 
slooksterPSV said:
Do you guys have Apache installed? Cause thats kind of the main component for installing anything like that. I'm not sure what Mac offers on its OS or that, but I'm guessing that you have to manually download and install Apache.

No no, if it's OS X, Apache (1.3.x series) is installed by default. All you have to do is activate "Personal Web Sharing" or something named similar in the Network config.

Check the httpd.conf file - you're going to have to do this from a terminal. Also, www.macosxhints.com is a VALUABLE resource when configuring things that OS X "came with" but never activated.

I believe in OS X server, this stuff is a bit more "dummy proof" - that is, there's checkboxes that turn SQL/PHP on and off somewhere, etc. I don't see this really joining the main OS X "personal" in Tiger or beyond - many people consider PHP to be a potential security risk, and if you're not really a knowledgable sysadmin, it's safer to not have it on than to learn about all the necessary precautions.

-rand()
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.