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.

Local Host only showing source code...


Post Reply New Thread Subscribe

 
Thread Tools
RIRedinPA

 
Member Since: Dec 05, 2009
Posts: 5
RIRedinPA is on a distinguished road

RIRedinPA is offline
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...?
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,433
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
And you are viewing these HTML files with?

Regards
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,769
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
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
QUOTE Thanks
RIRedinPA

 
Member Since: Dec 05, 2009
Posts: 5
RIRedinPA is on a distinguished road

RIRedinPA is offline
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>
QUOTE Thanks
wheelguy

 
wheelguy's Avatar
 
Member Since: Jun 18, 2006
Location: Minneapolis
Posts: 191
wheelguy will become famous soon enough
Mac Specs: MacBook Pro

wheelguy is offline
By default php is not enabled in webserver.

If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,433
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
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
QUOTE Thanks
dwright

 
Member Since: Dec 10, 2009
Location: Canton, Ohio
Posts: 17
dwright is on a distinguished road
Mac Specs: Various Mac Minis, Mac Mini Servers

dwright is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« How to register your website with Google? | dreamweaver site, own domain & mobileme hosting problems »
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
Local host name Already in Use??? code777 OS X - Operating System 6 06-01-2012 09:13 AM
host a local network website draconis46 Web Design and Hosting 2 10-10-2007 02:56 PM
my local host and php are not playing nice? este Web Design and Hosting 2 07-26-2005 06:08 PM
local host vic one Web Design and Hosting 8 02-06-2005 02:21 PM

All times are GMT -4. The time now is 03:24 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?