PHP on MacOS Apache server

This is a discussion on "PHP on MacOS Apache server" within the PHP Forum section. This forum, and the thread "PHP on MacOS Apache server are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 28th, 2007, 14:05
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
PHP on MacOS Apache server

I work on Mac OS 10.3.9. I use skEdit for coding.
I have started using php includes on my site.
Problem is I can only preview them by uploading to my remote server as the Apache server on my mac doesn't handle php files.
I'd like to be able to preview pages on my mac without uploading to the remote web server.

I've downloaded php, but whoa! those installation instructions are way beyond me. I'm not an IT expert, just a humble graphic/web designer. Is this worth me pursuing? I just don't have the time to learn a whole new coding language (just getting by with html, css and some javascript!!).

Any tips/pointers?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 28th, 2007, 14:42
BGarner's Avatar
Reputable Member
Join Date: Oct 2006
Location: In front of the computer.
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

If you want to learn PHP, go for it. Get yourself a good hosting package and a domain name and your server should support PHP.

If not, just let someone else do it, you can always subcontract parts of design jobs to other people more specialized in the technical aspect of web design.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 28th, 2007, 15:00
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Thanks. I have a host, domain name and website and all that.
What I do want to do though is to preview my work before I upload it to my webserver i.e. on the apache server on my mac. I'd like to able to test and play around with new pages before I upload them to my public space.
Apart from that, and pardon my ignorance!... but to start learning php do I not need to install anything on my computer?
Heyulp!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 29th, 2007, 00:26
Most Reputable Member
Join Date: Dec 2006
Location: San Francisco
Age: 57
Posts: 1,567
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

To bad Macs come with Apache. I would suggest you download XAMPP for Macs. Its apache, mysql and phpadmin all toether. I use the windows version but I can view my php work locally..which it sounds like you want to do. If you want to look at it

http://www.apachefriends.org/en/xampp.html
Last Blog Entry: More Sara Blogging (Nov 29th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 29th, 2007, 09:49
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Hi Sannbe,
Yeah I looked at that site once before but the warning put me off a bit.
Quote:
WARNING: This version of XAMPP is still in the first steps of development. Use at you own risk!
Its also for a later OS than I have and then the help forums are in German!!! I really do draw the line at learning German before I can learn php!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 29th, 2007, 14:31
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Ha. Youw ill need to install php locally if you want to view php files locally. It is a bit technical but it's not too bad when you work it out. Read through the instrudtions again and see if it clicks. I haven't installed php in a while as I don't really bother with it but I'll have a look and see if I can work it out.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jun 29th, 2007, 18:40
Most Reputable Member
Join Date: Dec 2006
Location: San Francisco
Age: 57
Posts: 1,567
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

You don't have to learn german. Scroll down the forum page and you will find an English version.
Last Blog Entry: More Sara Blogging (Nov 29th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 29th, 2007, 20:06
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Hang on, folks ... Apache on OS X *is* built with PHP - it's just that you need to change the config file to enable it. As I recall, the lines you need are even in the configuration file - just commented out by default!

Code: Select all
dolphin:/etc/httpd graham$ diff httpd.conf.default httpd.conf        
240c240
< #LoadModule php4_module        libexec/httpd/libphp4.so
---
> LoadModule php4_module        libexec/httpd/libphp4.so
284c284
< #AddModule mod_php4.c
---
> AddModule mod_php4.c
dolphin:/etc/httpd graham$
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 29th, 2007, 21:03
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Ooer! that looks scary!! Good news though! I knew you wouldn't let me down!I'm afraid I don't know how to change the config though!
Could you clue me in on how to do that please Grahame?

Sannbe - glad I don't have to learn German - cheers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jun 30th, 2007, 04:56
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

The file to change is /etc/httpd/httpd.conf ... you simply remove the # character from the front of lines 240 and 284 (line number may differ a bit on different OS X versions). The report I have posted up is from the shell "diff" command that shows all changes to a file - you see the before and after in my "scary bit". Use any text editor that you like - there are lots of them in OS X.

Having made the change, turn off and turn on again the web sharing in your system settings, OR reboot, and this change is made to a configuration file to effects apache httpd as it starts up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jun 30th, 2007, 05:47
Most Reputable Member
Join Date: Dec 2006
Location: San Francisco
Age: 57
Posts: 1,567
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Snappy, its relatively easy to change the config file. Apache is real good about IDing how to make things work on their server by making changes in the config files. However, I will not tell you how many times I added or removed the wrong thing (apache crash) until, by trial and error, success well, 1 maybe 2 times.... I wish I could give you more help but I am stil working on getting apache not to growl at me.
Last Blog Entry: More Sara Blogging (Nov 29th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jun 30th, 2007, 13:48
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

I really am a novice at this side of things. Where do I find the config file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jun 30th, 2007, 14:36
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Top level folder "etc" ... in there a folder called "httpd" ... and the file is called httpd.conf

Where in the UK are you? If you happen to be near to us ... we could sort you out "in real life"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jun 30th, 2007, 15:19
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

I've done a search for all of those things but no result !
I'm on Mac OS 10.3.9 if that helps...
By the way I'm in North Wales, bit of a trek!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Jul 2nd, 2007, 04:11
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

It'll be there. Just not visible through things like finder (at least that's the situation I have). I use a shell window and vi to work at an underlying unix level as I'm not an OS X expert ... and not knowing much about the OS X specifics it's probable best for me to leave other who are to advise further on how best to edit the file in question using point and click tools.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jul 3rd, 2007, 18:21
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP on MacOS Apache server

Sounds like something beyond the realm of standard preference setting. Will search some mac forums and post my findings here if they might be of use to some other poor lost soul like me!
Thanks for your help so far everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
apache, installation, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT!!!! Send HTTP request from one web server to another server chandra.nowduri ASP.NET Forum 1 Aug 7th, 2006 19:18
PHP/Apache ktsirig PHP Forum 2 Feb 9th, 2006 03:44
Need to process data on one server, utilize it on another server ... can it be done? jaobrien Classic ASP 1 Dec 6th, 2005 00:58
Apache Alan PHP Forum 3 Aug 4th, 2005 12:48
Can ASP run on a apache web server on a windows xp home edit jperson19468 Classic ASP 9 Aug 8th, 2004 10:45


All times are GMT. The time now is 17:01.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42