Results 1 to 12 of 12
  1. #1


    Member Since
    Dec 10, 2007
    Posts
    6
    How to test php offline?
    I am new to web stuff, and am running 10.5.4. I am trying to find if it is possible to test php offline, because where I volunteer in the day has no wi-fi, but I try to work on some php im learning.
    I have php installed, obviously, as well as apache. I have uncommented the lines in httpd.conf file, and I have enabled websharing in system prefs.
    I created a simple test.php file that calls phpinfo(), and it works I know because I ran it from terminal. But when I put the file into /library/websharing/documents and point localhost to it, all it does is display the code, not the info. Isn't it supposed to interpret the php that way? If not, is there anyway to do that?
    Thank you for help!

  2. #2

    dekan's Avatar
    Member Since
    Mar 16, 2007
    Posts
    756
    Hey!

    There is a software called XAMPP, which is for free and installs an apache server, SQL, ... on your mac. Easy to use. I love it for web development.

    http://www.apachefriends.org/en/xampp-macosx.html

  3. #3


    Member Since
    Dec 10, 2007
    Posts
    6
    I already have php and apache installed, thats why im stuck I think.
    For example, if I open a browser and type in http://localhost I get an apache start page saying that installation of apache was succesful...

  4. #4


    Member Since
    Dec 24, 2006
    Location
    N. Ireland
    Posts
    901
    Specs:
    Mac Pro 2xQuad core 2.8GHZ
    copy your php file in to the htdocs folder of your apache server then point your browser at the file you wish to test

    eg

    http://localhost/testthis.php

  5. #5


    Member Since
    Dec 10, 2007
    Posts
    6
    what is a hotdocs folder?
    I had been putting the files into Mac->Library->webserver->documents

  6. #6

    wheelguy's Avatar
    Member Since
    Jun 18, 2006
    Location
    Minneapolis
    Posts
    191
    Specs:
    MacBook Pro
    the htdocs folder is the "local web server" this is where you would put your folder containing all of the html, php, images folder, other folders. Generally you would view through a web browser on your machine with the address http://localhost/webfoldername/filename.php
    Check out www.apachefriends.org they have an apache/mysql setup for mac called xampp.
    If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi

  7. #7

    Josso's Avatar
    Member Since
    Jun 07, 2008
    Location
    Denmark, Europe
    Posts
    30
    Specs:
    None... :(
    I think that MAMP sounds way easier. (Something a Mac worth)
    - Josso!
    Know more than some new Mac-users, but they're so expensive.
    Hope they'll be it worth.

  8. #8


    Member Since
    Nov 26, 2008
    Posts
    5
    Quote Originally Posted by wheelguy View Post
    the htdocs folder is the "local web server" this is where you would put your folder containing all of the html, php, images folder, other folders. Generally you would view through a web browser on your machine with the address http://localhost/webfoldername/filename.php
    Check out apache friends - very easy apache, mysql, php and perl installation without hassles they have an apache/mysql setup for mac called xampp.
    I'm having issues with this part. It simply will not connect to htdocs!

  9. #9

    wheelguy's Avatar
    Member Since
    Jun 18, 2006
    Location
    Minneapolis
    Posts
    191
    Specs:
    MacBook Pro
    Make sure that you have started the xampp program, it does not automatically run on startup.
    If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi

  10. #10


    Member Since
    Dec 31, 2005
    Posts
    24
    I second MAMP as well. Select the htdocs folder, right click, make alias, then drag that to your home folder (I named mine www). Then start up MAMP and you are good to go.
    PowerBook G4 15" 1.5Ghz | 2GB PC2700 | 80GB HDD | OSX 10.4.11

  11. #11


    Member Since
    Jan 30, 2009
    Posts
    48
    Quote Originally Posted by Josso View Post
    I think that MAMP sounds way easier. (Something a Mac worth)
    have used this for a long time. works great. even has a widget to turn on/off your php server. great for testing.

  12. #12


    Member Since
    Jan 31, 2009
    Posts
    6
    type this into google
    typo3

    get that and yout laughing
    it sets up php and mysql localy all by its self and it runs smoooooth

    its great basically

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hardware Test and Memory Test
    By Marrk in forum OS X - Operating System
    Replies: 4
    Last Post: 07-10-2011, 01:22 AM
  2. Offline Media
    By motumedia in forum Movies and Video
    Replies: 1
    Last Post: 05-26-2009, 07:05 AM
  3. Printer offline
    By aggie97 in forum Other Hardware and Peripherals
    Replies: 3
    Last Post: 04-27-2009, 06:22 PM
  4. Offline php and MYSQL server.
    By StonePatch in forum OS X - Apps and Games
    Replies: 2
    Last Post: 09-10-2006, 12:52 PM
  5. Setting up PHP and PHP Nuke
    By EvoMac in forum Web Design and Hosting
    Replies: 2
    Last Post: 02-18-2005, 01:38 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
  •