Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    PHP on Local Machine

    Member Since
    Feb 09, 2005
    Posts
    841
    PHP on Local Machine
    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!

  2. #2
    PHP on Local Machine
    cazabam's Avatar
    Member Since
    Jun 06, 2006
    Posts
    1,153
    Specs:
    MacBook 2.0GHz White, 512MB RAM, 60GB HDD
    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.

  3. #3
    PHP on Local Machine

    Member Since
    Feb 09, 2005
    Posts
    841
    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?

  4. #4
    PHP on Local Machine
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    If your not going to use any of the extras that XAMPP installs then I suggest you just try getting PHP working.

  5. #5
    PHP on Local Machine

    Member Since
    Feb 09, 2005
    Posts
    841
    Ok, thanks for that guys!

  6. #6
    PHP on Local Machine
    knightlie's Avatar
    Member Since
    Mar 22, 2007
    Location
    UK
    Posts
    1,463
    Specs:
    Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
    Get MAMP. Nuff said.
    [URL="http://beadia.net"]Beadia[/URL - Jewelry Business Management Software]
    I judge you when you use poor grammar.

  7. #7
    PHP on Local Machine
    cazabam's Avatar
    Member Since
    Jun 06, 2006
    Posts
    1,153
    Specs:
    MacBook 2.0GHz White, 512MB RAM, 60GB HDD
    MAMP! I knew there was another one, but couldn't remember for the life of me what it was.

  8. #8
    PHP on Local Machine

    Member Since
    Feb 09, 2005
    Posts
    841
    Yup, I'm using MAMP... its very effective. Straight forward too.

  9. #9
    PHP on Local Machine
    knightlie's Avatar
    Member Since
    Mar 22, 2007
    Location
    UK
    Posts
    1,463
    Specs:
    Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
    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.

  10. #10
    PHP on Local Machine

    Member Since
    Feb 09, 2005
    Posts
    841
    Yup..... and LAMP for Linux. (a major help!)

  11. #11
    PHP on Local Machine

    Member Since
    Jul 06, 2007
    Posts
    16
    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
    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

  12. #12
    PHP on Local Machine

    Member Since
    Jul 08, 2007
    Location
    SLC, UT
    Posts
    31
    Specs:
    Macbook Pro, 2.2Ghz, 4GB Memory, 120GB HDD, LCD Display, OS X Tiger
    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.

  13. #13
    PHP on Local Machine

    Member Since
    Jul 06, 2007
    Posts
    16
    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.

  14. #14
    PHP on Local Machine

    Member Since
    Jul 06, 2007
    Posts
    16
    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????

  15. #15
    PHP on Local Machine
    knightlie's Avatar
    Member Since
    Mar 22, 2007
    Location
    UK
    Posts
    1,463
    Specs:
    Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Local Machine Name Changed
    By eyeball in forum Apple Desktops
    Replies: 1
    Last Post: 03-31-2009, 08:59 AM
  2. Local Machine Name Changed.
    By eyeball in forum OS X - Operating System
    Replies: 3
    Last Post: 03-30-2009, 10:18 AM
  3. Inserting Images from Local hard drive into html in PHP Site
    By samanthad in forum Web Design and Hosting
    Replies: 1
    Last Post: 09-25-2008, 02:49 AM
  4. Testing PHP/MySQL on local machine ?
    By Liam in forum OS X - Apps and Games
    Replies: 3
    Last Post: 07-29-2007, 06:18 AM
  5. my local host and php are not playing nice?
    By este in forum Web Design and Hosting
    Replies: 2
    Last Post: 07-26-2005, 06:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •