New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

PHP on Local Machine


Post Reply New Thread Subscribe

 
Thread Tools
iRock

 
Member Since: Feb 09, 2005
Posts: 842
iRock will become famous soon enough

iRock is offline
Hey, Im planning on working on a site in PHP in DW.

I was just wondering is there anyway that I can preview the PHP on my iMac locally rather than having to upload it to a web server everytime?

I've looked at XAMPP... would this do the job that I want and if so is it ok to just download this, intall and then run it in the background?

Heres the link to what I'm looking at
http://www.apachefriends.org/en/xampp.html


All help appreciated!
QUOTE Thanks
cazabam

 
cazabam's Avatar
 
Member Since: Jun 06, 2006
Posts: 1,153
cazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of light
Mac Specs: MacBook 2.0GHz White, 512MB RAM, 60GB HDD

cazabam is offline
The built-in apache that comes with OS X has a PHP 4 interpreter, but it needs to be turned on by editing httpd.conf (in /etc/httpd/httpd.conf) to uncomment all the bits related to PHP (there should be three or four sections, just searching for 'php' within the file will find it). A tutorial is here: http://www.devarticles.com/c/a/Apach...P-on-Mac-OS-X/

However, XAMPP provides a coherent whole so you don't have to worry about all that. There is a warning about it being in an early stage of development, but it's certainly the easiest way to get everything up and running.
QUOTE Thanks
iRock

 
Member Since: Feb 09, 2005
Posts: 842
iRock will become famous soon enough

iRock is offline
Quote:
Originally Posted by cazabam View Post
The built-in apache that comes with OS X has a PHP 4 interpreter, but it needs to be turned on by editing httpd.conf (in /etc/httpd/httpd.conf) to uncomment all the bits related to PHP (there should be three or four sections, just searching for 'php' within the file will find it). A tutorial is here: http://www.devarticles.com/c/a/Apach...P-on-Mac-OS-X/

However, XAMPP provides a coherent whole so you don't have to worry about all that. There is a warning about it being in an early stage of development, but it's certainly the easiest way to get everything up and running.
Thanks for the info.

Yeah I understand that it is in early stages of development but I don't think that I would be doing anything too major with it as I am just starting out with PHP.

So you think I should use XAMPP or just stick with the built in Apache?
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
If your not going to use any of the extras that XAMPP installs then I suggest you just try getting PHP working.
QUOTE Thanks
iRock

 
Member Since: Feb 09, 2005
Posts: 842
iRock will become famous soon enough

iRock is offline
Ok, thanks for that guys!
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
Get MAMP. Nuff said.

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks
cazabam

 
cazabam's Avatar
 
Member Since: Jun 06, 2006
Posts: 1,153
cazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of lightcazabam is a glorious beacon of light
Mac Specs: MacBook 2.0GHz White, 512MB RAM, 60GB HDD

cazabam is offline
MAMP! I knew there was another one, but couldn't remember for the life of me what it was.
QUOTE Thanks
iRock

 
Member Since: Feb 09, 2005
Posts: 842
iRock will become famous soon enough

iRock is offline
Yup, I'm using MAMP... its very effective. Straight forward too.
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
MAMP is great, it's easier than banging your head on something. And for Windows users there's a similar WAMP package that does the same thing.

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks
iRock

 
Member Since: Feb 09, 2005
Posts: 842
iRock will become famous soon enough

iRock is offline
Yup..... and LAMP for Linux. (a major help!)
QUOTE Thanks
snappy

 
Member Since: Jul 06, 2007
Posts: 16
snappy is on a distinguished road

snappy is offline
A tutorial is here: http://www.devarticles.com/c/a/Apach...P-on-Mac-OS-X/I really want to get php working on my mac.
I followed the tutorial you suggested and get as far as
Quote:
Use the following command in the Terminal.app:

sudo pico httpd.conf
but can't work out how to actually open the file or see any of the code I need to edit. Can anyone tell me where I go from here?


Hopingly, thanks
QUOTE Thanks
supergper

 
Member Since: Jul 08, 2007
Location: SLC, UT
Posts: 31
supergper is on a distinguished road
Mac Specs: Macbook Pro, 2.2Ghz, 4GB Memory, 120GB HDD, LCD Display, OS X Tiger

supergper is offline
Quote:
Originally Posted by snappy View Post
A tutorial is here: http://www.devarticles.com/c/a/Apach...P-on-Mac-OS-X/

I really want to get php working on my mac.
I followed the tutorial you suggested and get as far as


but can't work out how to actually open the file or see any of the code I need to edit. Can anyone tell me where I go from here?


Hopingly, thanks

It looks like you are not in the correct directory. Before typing "sudo pico httpd.conf" you have to type "cd /etc/httpd/" then type "sudo pico httpd.conf" and you should see everything. I bet right now if you look in you home folder you'll now have a file called httpd.conf, open it in TexEdit and it'll be blank.
QUOTE Thanks
snappy

 
Member Since: Jul 06, 2007
Posts: 16
snappy is on a distinguished road

snappy is offline
Yes, you're right. The httpd.conf file in my 'home' folder is empty. Its also called 'httpd.conf.save'
I've tried again in a different way and got to a window like this:


I can find
#LoadModule php4_module
#AddModule mod_php4.c

but not
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps

Even when I do a search for these, they do not show. Can you give me any clues what might be going wrong here? I'm wary of tinkering too much as I (quite clearly) don't know much about the UNIX side of things.
QUOTE Thanks
snappy

 
Member Since: Jul 06, 2007
Posts: 16
snappy is on a distinguished road

snappy is offline
Right, so now I find this in my httpd.conf file.

Code:
<IfModule mod_php4.c>
    # If php is turned on, we repsect .php and .phps files.
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    
    # Since most users will want index.php to work we
    # also automatically enable index.php
    <IfModule mod_dir.c>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>
A # sign doesn't appear b4 the lines as I expected. Any ideas????
QUOTE Thanks
knightlie

 
knightlie's Avatar
 
Member Since: Mar 22, 2007
Location: UK
Posts: 1,463
knightlie is just really niceknightlie is just really niceknightlie is just really niceknightlie is just really nice
Mac Specs: Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen

knightlie is offline
Are you using MAMP? If you're trying to get PHP scripts to run, it sets up all that stuff for you.

[URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
I judge you when you use poor grammar.
QUOTE Thanks

Post Reply New Thread Subscribe


« Linking to a file on a network machine | iWeb keeps saving text as .png?! »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Can I map the superdrive on another mac on a local network? jonnyd OS X - Operating System 0 05-15-2007 07:17 PM
Parallels - can't copy from Windows XP virtual machine and paste to Mac Pro ithacalaw Running Windows (or anything else) on your Mac 5 10-22-2006 10:14 PM
LDAP and local login Skatta OS X - Operating System 1 11-29-2005 11:49 AM
my local host and php are not playing nice? este Web Design and Hosting 2 07-26-2005 07:08 PM
Setting up PHP and PHP Nuke EvoMac Web Design and Hosting 2 02-18-2005 01:38 PM

All times are GMT -4. The time now is 10:34 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?