Click to See Complete Forum and Search --> : Simple problem?


owltime
01-16-2007, 01:46 PM
Hi Folks,

My server supports PHP and my HTML code works OK i.e. I can get to display in Explorer.
However the probs arrive when I try and create a PHP file in notepad and save it with .PHP extension.I then try and open it in the browser and it just keeps coming up page not found.
I have tried typing "localhost.filename.php" into my web address bar but this also fails.I have also tried browsing for the file on the system and opening it like that but it fails again.

I am completely new to php.I wonder if anybody could tell me if I am overlooking something very simple:)

Regards
Owltime

The Little Guy
01-16-2007, 02:54 PM
try:
localhost/filename.php

or use your IP address:
xxx.xxx.xxx.xxx/filename.php

Make sure the file is in the htdocs folder.

owltime
01-16-2007, 03:18 PM
Hi Little Guy.

Thankyou for your reply.What is the ht.docs.?To date I have been saving my files in the in my webs directory and have also tried saving them in localhost/filename.php.

Regrads
owltime

The Little Guy
01-16-2007, 03:24 PM
Did you download a web server on your computer, and PHP?

If no, you can download it here:
http://www.apachefriends.org/en/xampp-windows.html#641
The above link, all you need to do is download, install, and your good to go.

If yes, the folder should be in your web server's directory
C:\Program Files\Your Web Server\htdocs\filename.php

owltime
01-16-2007, 03:37 PM
Hi Small Guy,

I did try downloading PhP 5.2 Apachi and Mysql individually but still had the same problem.So I got rid of all that and downloaded the whole thing via a program called WAMP(via sourceforge).
This (so it said) didn't need configuring in any way,but the same problem still persists.:confused:

Regrads
Owl:)

The Little Guy
01-16-2007, 03:39 PM
Where exactly are you saving your file? copy and paste the address from your explorer bar (Not from your browser, it should start with C:\).

owltime
01-16-2007, 03:43 PM
Hi Small Guy,

I have been saving my file in the my webs directory,and then opening it up again in my browser (IE)

regards
Owl

The Little Guy
01-16-2007, 03:53 PM
Can I see the directory path?

owltime
01-16-2007, 04:08 PM
Hi SmallGuy

There is no directory path as such.
Here's what I do.

Write the code.I.E.

<?php
phpinfo();
?>

then I save it in notepad as a php file a tick all files in the box.

then I go to explorer and do one of two things
1)go to the address bar and type in localhost/filename.php
2)go to the file menu click open and go in search of the file that I usually save to my webs in my docs.
but none of this has worked.
Hope this explanation makes sense

Regards
owli

The Little Guy
01-16-2007, 04:18 PM
Well, the only thing I can think of is that your saving the file to the wrong place, and the only way for this to work is if you save it in the pre defined folder, which is probably this:

C:\Program Files\WAMP\htdocs\

The only way for php to work is if you run it from the address bar, you cannot do file > open > browse

owltime
01-16-2007, 04:31 PM
Hi Small guy,

Thanks for all of your help I will try your latest suggestion tomorrow,unfortunately work calls.

Many many thanks for you time and I will let you know how I get on

Kind regards
Owl