PHP on Local Machine

Joined
Jul 6, 2007
Messages
16
Reaction score
0
Points
1
er! oops! sorry, your replies didn't show.
Will look at them tomorrow, when I've taken my pills!
 
Joined
Oct 7, 2005
Messages
346
Reaction score
14
Points
18
Location
Seattle
Your Mac's Specs
MBP CD 1.83/2ghz/7200 100g + Mini 2ghz C2D 2gb + Mini 1.42ghz G4 + PM 7200/120 + Newton OMP
Easiest way is to go into sharing system pref, then uncheck personal web sharing, wait a minute, then click it back on. You can do it from the terminal too, but this is the easiest way.
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
D'you think I'm an applemacslave?Hate this planned obsolescence crap that mac (with their 'right on' marketing) try and suck us all in!

Apple didn't write MAMP, so it's hardly their fault for adding features to OSX, is it. We still need a rolleyes smilie here.
 
Joined
Jul 6, 2007
Messages
16
Reaction score
0
Points
1
Easiest way is to go into sharing system pref, then uncheck personal web sharing, wait a minute, then click it back on. You can do it from the terminal too, but this is the easiest way.

I've tried that now... no joy!
Is there a way that I can revert the httpd.conf file back to default i.e. can I reinstall it from my system CD to be sure that it isn't corrupted in any way?
 
Joined
Oct 7, 2005
Messages
346
Reaction score
14
Points
18
Location
Seattle
Your Mac's Specs
MBP CD 1.83/2ghz/7200 100g + Mini 2ghz C2D 2gb + Mini 1.42ghz G4 + PM 7200/120 + Newton OMP
Restoring your httpd.conf from the system CD is not a trivial matter, as it is probably embedded in a .pkg file. You might be able to do a "open package contents" by right clicking on it and digging around for the file. It's not that difficult, but it may take some looking around for the right .pkg file and the right directory for it.

In any case, if you want to see if you accidentally corrupted your httpd.conf file, you can always open a terminal session and type:

Code:
more /var/log/httpd/error_log

The space bar will page through the file if it's longer than a single screen (or you can open it from inside TextEdit)

I could probably PM you a copy of my httpd.conf that you could use. Mine is a little more tweaked than simply adding php support however (seems to me that I made some changes for allowing some cgi scripting and opened up access to read directory listings, which does decrease security a bit). I'm also pretty sure I recompiled php to add MySQL and Oracle connectivity support, but I don't think I had to modify my apache config to support that.
 
Joined
Jul 6, 2007
Messages
16
Reaction score
0
Points
1
In any case, if you want to see if you accidentally corrupted your httpd.conf file, you can always open a terminal session and type:

more /var/log/httpd/error_log
Hmmm! tried that and I'm afraid the results don't mean that much to me.
Restoring your httpd.conf from the system CD is not a trivial matter, as it is probably embedded in a .pkg file. You might be able to do a "open package contents" by right clicking on it and digging around for the file. It's not that difficult, but it may take some looking around for the right .pkg file and the right directory for it.
You're right. Not much joy in finding in that, especially as I don't have a right click!
I could probably PM you a copy of my httpd.conf that you could use.
Do you think that if I pasted your file contents it could do any serious damage? Otherwise I guess I could, at least, compare the two.
Thanks for your help so far!
 
Joined
Oct 7, 2005
Messages
346
Reaction score
14
Points
18
Location
Seattle
Your Mac's Specs
MBP CD 1.83/2ghz/7200 100g + Mini 2ghz C2D 2gb + Mini 1.42ghz G4 + PM 7200/120 + Newton OMP
You're right. Not much joy in finding in that, especially as I don't have a right click!
Well holding control and clicking gives you a right-click if you don't have an external mouse.

Do you think that if I pasted your file contents it could do any serious damage? Otherwise I guess I could, at least, compare the two.
Thanks for your help so far!
Damage? No. Worst thing that could happen is that Apache wouldn't start, but since that seems to be the case now...

I'd recommend backing up the old one first... Go into Terminal and do...

Code:
sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.bak
...and enter your administrator password. I'm attaching my httpd.conf as httpd.conf.txt. Save that somewhere and copy it into place. If you put it on your desktop, then go into Terminal and do...

Code:
sudo mv ~/Desktop/httpd.conf.txt /etc/httpd/httpd.conf
I'm also including httpd.conf.bak.txt that I found laying about. I think it's the default httpd.conf that I backed up before I made my changes. The changes I see (from doing a diff) are:

  • Decreased number of servers from 5 to 1 (saves a little bit of memory)
  • Added php4 module
  • Added bonjour module
  • Changed httpd process from user nobody to user www

That last change is the only one I can think of that might cause problems. Perhaps someone here who has a vanilla httpd.conf can say which of the following lines they have in their file (from the output of my diff):

Code:
332,333c330,331
< User www
< Group www
---
> User nobody
> Group nobody

Obviously you'll have to restart apache afterward... I'm keeping my fingers crossed. This is probably self-evident, but if you have troubles, restore from your backup in the Terminal with

Code:
sudo cp /etc/httpd/httpd.conf.bak /etc/httpd/httpd.conf
...and restart Personal Web Sharing from the Sharing System Preference.

View attachment httpd.conf.txt

View attachment httpd.conf.bak.txt
 
Joined
Jul 6, 2007
Messages
16
Reaction score
0
Points
1
Phew! Will let you know how I get on.
Thanks for all your help!
PS. I'm ashamed to say I didn't know I could get a rt-click by holding down ctrl.
 
Joined
Jul 6, 2007
Messages
16
Reaction score
0
Points
1
It's frustrating. I've done all you advised... and turned PWS off... and now it won't come back on!! Just has msg "Personal Web Sharing starting up" but not seeming to get anywhere.
Help! D'you think I should reinstall my OS or give in and get hold of MacOS10.4 and MAMP??
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
Maybe typing at the terminal the following line will give you a clue to what is wrong;

apachectl configtest
 

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