PHP and MySQL issues

Discussion in 'Mac Apps and Mac App Store' started by Brother Michael, Sep 28, 2004.

  1. Brother Michael macrumors 6502a

    Brother Michael

    Joined:
    Apr 14, 2004
    #1
    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
     
  2. slooksterPSV macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #2
    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.
     
  3. Brother Michael thread starter macrumors 6502a

    Brother Michael

    Joined:
    Apr 14, 2004
  4. slooksterPSV macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #4
    I would, and see if the PHP works still or that.
     
  5. Brother Michael thread starter macrumors 6502a

    Brother Michael

    Joined:
    Apr 14, 2004
    #5
    Sorry that was a typo.

    I mean HOW do I remove PHP?

    Mike
     
  6. BeoVir macrumors member

    Joined:
    Jun 3, 2004
    Location:
    Detroit, MI
    #6
    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.
     
  7. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #7
    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.
     
  8. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #8
    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.
     
  9. Brother Michael thread starter macrumors 6502a

    Brother Michael

    Joined:
    Apr 14, 2004
    #9
    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
     
  10. slooksterPSV macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #10
    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.
     
  11. rand() macrumors regular

    Joined:
    Jul 15, 2004
    Location:
    Michigan
    #11
    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()
     

Share This Page