Forum Moderators: phranque

Message Too Old, No Replies

problem viewing php locally

         

elias75

2:54 pm on Mar 11, 2009 (gmt 0)

10+ Year Member



Hello all,
this is my first post, nice to be here!

here is my problem (btw I am newbie in webdesign): I am using dreamweaver CS3, XP home edition, SP3 and XAMPP 1.6.7
my first ever complete project is a static html site that has only one php page (the contact page) with a nice php script. All the manage site definitions in DW are correct, all links are correct my Apache server seems to run correcly etc. When I test the site locally in FF & IE everything works fine except for the contact page. When I click on "contact" from the menu I get a dialog box what to do with file: 'save as' or 'open with' ... also from DW when I click on "Live Data View" I get the message :"HTTP error 404 file not found... possible reasons for the problem:
Files in the "..............." folder that have the ".php" file extension are not being executed by the testing server.
2) The "..............." folder does not map to the "http://localhost/....." URL on the testing server. Verify that the URL Prefix maps to the root of your site.

the thing is that a friend of mine uploaded all the website files to his host and everything works fine! I just cannot test things localy...

please help, I am trying to figure it out but so far no luck

many thanks in advance

jdMorgan

7:12 pm on Mar 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Depending on several server and PHP version factors, you will need to add either an AddHandler or an AddType directive to tell the server to *execute* the PHP code instead of serving it as source code (text) to the browser.

There are a couple of threads in the WebmasterWorld PHP Forrum library on setting up PHP that go into this in some detail.

Jim

elias75

7:16 pm on Mar 11, 2009 (gmt 0)

10+ Year Member



many thanks Jim! I really appreciate this. I will look for those threads right away!
cheers!

elias75

5:10 pm on Mar 12, 2009 (gmt 0)

10+ Year Member



I am still stuck... I have downloaded the 1.7.0 version of xampp - thought that would resolve the problem - but no luck...
also I searched the php thread but I can't see an answer to my problem there too....

elias75

6:29 pm on Mar 12, 2009 (gmt 0)

10+ Year Member



I was given the answer to this question! And works fine now...
So, no matter what, even if you only have one php page and the rest are html, you need
to save all your website files in the C:\xampp\htdocs\whatever_name_is_your_folder_with_website
and then access locally your creation via C:\localhost\whatever_name_is_your_folder_with_website

<snip>

[edited by: jdMorgan at 1:08 am (utc) on Mar. 13, 2009]
[edit reason] No promotions or URLs, please. [/edit]