PHP won't activate in OS X 10.3

Discussion in 'Mac OS X Server, Xserve, and Networking' started by Pegasi Delta, Apr 17, 2009.

  1. Pegasi Delta macrumors newbie

    Apr 17, 2009
    I recently got given an old G4 Power Mac running Panther as the owner upgraded to a Mac Mini, and I thought it would be cool to turn it into a home webserver. I was pretty relieved when I found out that this could be done without shelling out for OS X Server Edition, and promptly went about activating web sharing and getting DynDNS to put it on the web.

    My ultimate aim is to be able to run a forum on this server, and I therefore need MySQL and PHP up and running on it. I installed MySQL, and I set to work trying to activate PHP. I tried editing the default httpd.conf file for Apache but to no avail (the tutorial I followed was the O'Reilly Media one found here most notably, but I tried everything I could find on google tbh, that seemed the most in depth guide and included everything I found elsewhere). I've followed all the instructions but PHP still won't seem to activate, the test file detailed doesn't display properly, and when I try to install SMF (the forum I want to use), the page doesn't display properly and I get the message that I don't have PHP.

    I therefore gave that one up and tried WebServerX Kit, which looked good as it included a newer version of Apache (2 as opposed to the 1.3 *I think* that comes as standard on OS X 10.3), MySQL and PHP 5, also had the advantage that I got a handy Pref Pane in System Preferences to work with. Downloaded and installed this, still I got the same problem when I tried to install SMF: no PHP. I therefore decided to see if I could make this work by editing the httpd.conf file for the newer version of Apache, I thought it should work straight off but thought this worth a try. I again used the O'Reilly Media guide linked above to guide my changes. Still nothing.

    Looking at the whole series of articles on O'Reilly media (the one linked above is only on PHP, and part of a larger series of 6 articles on general web-serving on OS X, the directory of all 6 articles can be found here), I thought that maybe something else was the problem, possibly all this mention of CGI, maybe even SSI (though I doubted this one). So I went back to my httpd.conf file for Apache 2 and followed all these steps as well, still nothing. Thinking that maybe the default httpd.conf file for the pre-installed Apache 1.3 was still the active one, I again followed all these new steps on this older .conf file. Still nothing.

    I'm honestly lost, I've tried literally everything I can see would be the problem, and looking at both .conf files and comparing them to all online guides I can find, PHP should be up and working. Does anyone know where I could be going wrong? I've spent hours trying to get this running and am kinda loth to give it up now.
  2. ChrisA macrumors G4

    Jan 5, 2006
    Redondo Beach, California
    You are going to have to look at the log files.

    My suggestion is to take it slower. It sounds like you are new to all of this so just take one step at a time. Walk then run.

    First get Apache running. Don't worry about GCI scripts. Just make a static page that says "hello World" and get that to work in a browser on the local machine, then on Internet connected machines.

    Next play with PHP (or Perl) from the command line. Run the scripts from the terminal. Finally place then where they go in gci-bin or wherever. If something does not work look at the logs.

    Same with MySQL or Postgresql, or whatever DBMS you like. Get it to work at the command line in the terminal and try out some simple SQL queries.

    When things don't work it is almost always file permissions.

    If all else fails t is easy to install Linux on the G4 Mac. It is free and a little easier to get working
  3. Pegasi Delta thread starter macrumors newbie

    Apr 17, 2009
    To be honest that is sound advice, and I am indeed new to all this.

    In fact I did get to this stage and tested it all before I proceeded, but after that I did indeed go ahead and try many many things without taking stock and looking at logs after each step.

    Would you be able to tell me exactly what I should be looking for after each step? Whilst I did try the test pages detailed in the guide I used after each step, I haven't really even touched on log files of any sort.

    Looking back my description does look like I went a bit crazy, but I did try to verify that things were working properly before proceeding and trying new options and changes to the httpd.conf file. But I will admit that log files didn't even enter the equation, and thinking about it now it would probably have been the best way to work out which step I went wrong on, or whether the problem is indeed file permissions.

    I think I'm gonna strip all the installed stuff off (WebserverX Kit, standalone MySQL), revert to the httpd.conf.bak file in default Apache and start over, so would you know both where and how to use log files so that I can slow myself down and work out exactly what is wrong? Also, any specific tips on file permissions would be much appreciated.

    I would prefer to keep it running OS X, partly because this G4 belongs partly to my dad, it's been a bit of a project whilst I'm home from university and the Mac was given to him, he in turn handed it over to me to try and get it web-serving. He doesn't really have much interest in the forum side of things, and it's working fine as a basic web-server, so I'm not sure he'll be OK with abandoning OS X and going with Linux instead. But, tbh, if I do keep running into dead ends then I'll try my best to convince him, and it is nice to know it's there as an option.

    Thanks for the advice, it's nice to have people in the know willing to help out someone like me who's really finding their feet with all this, cheers.

Share This Page