Results 1 to 7 of 7
  1. #1


    Member Since
    Dec 05, 2009
    Posts
    5
    Local Host only showing source code...
    I've got the files in the right location --Library/WebServer/Documents/...

    they're coded correctly (I do this for a living), they're just plain ole HTML files, nothing dynamic, no javascript, just html and css...

    I load them to the remote server and they work fine but when I go to view them locally I can only see the source code...

    What gives...?

  2. #2

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,503
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    And you are viewing these HTML files with?

    Regards

  3. #3

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    What extension are you using for your files?
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  4. #4


    Member Since
    Dec 05, 2009
    Posts
    5
    Files:
    Are PHP files, I'm viewing them in FF 3.0.11

    The file name is index.php

    Here's the path to the parent folder:

    http://localhost/knowink/mao/

    This should show me the index.php page, I get a directory listing instead.

    http://localhost/knowink/mao/index.php

    This is the path to the index page, it should definately show me the index page...I get the source code instead. This is a direct copy and paste from my browser window, not from the source code listing - if you had clicked Command-U in FF.

    I'm hoping not to come off arrogant here but I do this for a living, I build Mac apps and web based apps for a publishing company, in PHP using MySQL for a back end, heavy on AJAX and CSS, just started tinkering with HTML 5 (the geolocation stuff). I'm also pretty confident that this is probably user error (me ):

    <html>
    <head>
    <title>MAO 2009 Design 2</title>

    <script languag="javascript" src="js/mao.js"></script>
    <link rel="stylesheet" type="text/css" href="css/mao.css">
    </head>
    <body>


    <div id="header"><img src="images/maologo.png" border="0" class="logo" width="300"><img src="images/headergraphics.png" class="headerleft"></div>
    <div id="nav">
    <div id="navlinks">
    <ul>
    <li><a href="javascript:void(0);" onmousedown="showsubnav('mojobox');">Mojos</a></li>
    <li><a href="javascript:void(0);" onmousedown="showsubnav('mojos');">Spotlights</a></li>
    <li><a href="javascript:void(0);" onmousedown="showsubnav('mojos');">Destinations</a></li>
    <li><a href="javascript:void(0);" onmousedown="showsubnav('mojos');">The Campsite</a></li>
    </ul>
    </div>

    <div id="mojobox" style="display: none;" id="navbox">
    <ul>
    <li class="navbox_li">Ride</li>
    <li class="navbox_li">Camp</li>
    <li class="navbox_li">Hike</li>
    <li class="navbox_li">Snow</li>
    <li class="navbox_li">Water</li>
    </ul>
    </div>
    </div>

    <div id="content">
    <img src="images/1109/mao_1109_b_001.png">
    </div>
    </body>
    </html>

  5. #5

    wheelguy's Avatar
    Member Since
    Jun 18, 2006
    Location
    Minneapolis
    Posts
    191
    Specs:
    MacBook Pro
    By default php is not enabled in webserver.
    If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi

  6. #6

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,503
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    You initially said plain ole HTML files and now PHP..which is anything but plain ole HTML..

    Either way, as @wheelguy said, PHP support is available in Apache, but isn't enabled..so follow this guide and enable it.

    Regards

  7. #7


    Member Since
    Dec 10, 2009
    Location
    Canton, Ohio
    Posts
    17
    Specs:
    Various Mac Minis, Mac Mini Servers
    You can also configure Apache to render *.PHP files as *.HTML, but I think enabling PHP would be the best solution.

    in httpd.conf
    AddType text/html .php

    Once you have PHP installed it should read like this.

    AddType application/x-httpd-php .php

    Again, I would just enable PHP, but this is technical possible.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Local host name Already in Use???
    By code777 in forum OS X - Operating System
    Replies: 6
    Last Post: 06-01-2012, 09:13 AM
  2. ssh won't resolve host.local host names
    By mman426 in forum OS X - Operating System
    Replies: 3
    Last Post: 09-18-2009, 07:14 AM
  3. flash cannot load on local host
    By limazita in forum Web Design and Hosting
    Replies: 1
    Last Post: 03-12-2009, 04:25 PM
  4. host a local network website
    By draconis46 in forum Web Design and Hosting
    Replies: 2
    Last Post: 10-10-2007, 02:56 PM
  5. local host
    By vic one in forum Web Design and Hosting
    Replies: 8
    Last Post: 02-06-2005, 02:21 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
  •