Having problem in viewing php on localhost

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Having problem in viewing php on localhost

Postby lrasan » 10. September 2010 12:51

Hi,

I'm new to php programming and still learning. i installed xampp and both apache and mysql are indicated as running in the xampp control pannel. when i type http://localhost/ it takes me to the xampp main page.

but the php file i created using notepad wouldn't load. its a simple program with a single php line. i saved it in the htdocs folder ;
D:\xampp\htdocs\project1\test.php

when i try to view this page the following error show up;

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
9/10/2010 5:06:37 PM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1


the browser i am using is firefox, i tried view the page saving it directly in the htdocs folder but it still wont work, but the index.php page which was in xampp by default in the htdocs folder works fine.

please help me to solve this problem, thank you in advance
lrasan
 
Posts: 8
Joined: 10. September 2010 12:20

Re: Having problem in viewing php on localhost

Postby Altrea » 10. September 2010 15:17

What do you type in your browser address bar to request your file D:\xampp\htdocs\project1\test.php?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8290
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Having problem in viewing php on localhost

Postby lrasan » 11. September 2010 04:27

thanks for the reply :)

i type http://localhost/project1/test.php

i am following a book to learn php, so this is whats said in the book to type in
but when it didn't work i typed http://localhost/htdocs/project1/test.php still it didn't work
lrasan
 
Posts: 8
Joined: 10. September 2010 12:20

Re: Having problem in viewing php on localhost

Postby JonB » 11. September 2010 06:23

check the file name in Windows explorer, see if it might be test.php.txt :shock:

Good Luck
:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Having problem in viewing php on localhost

Postby lrasan » 11. September 2010 10:23

thank you JonB for the help :D

i checked in detail view, the document file type showed as php, but just to make sure i turned off Hide extensions for known file types from folder options, renamed the file as .PHP then viewed on browser with no problem.

thanks a lot :lol:
lrasan
 
Posts: 8
Joined: 10. September 2010 12:20

Re: Having problem in viewing php on localhost

Postby JonB » 11. September 2010 14:36

I'm glad its fixed. That is a common problem when people try to use Notepad for doing tasks its really not up to.

You should find a programmers' editor. Even the simplest free ones can save you endless time with little errors. Almost all do syntax highlighting (makes code very readable AND often reveals errors) and some have auto-completion (provides 'hints, possible values).

here's a good list
http://www.thefreecountry.com/programming/editors.shtml

I use the 'Emeral Editor' (it had a recent name change -- it used to be the Crimson Editor) and I have also used Notepad++.

http://www.emeraldeditor.com/

There are also fee full blown IDE's (Integrated Devlopment Environements) if you pursue things further (they are also a big learning curve). I use several of them for 'big tasks'. But for Perl or PHP quick work, I use the Cromson Editor.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Having problem in viewing php on localhost

Postby lrasan » 12. September 2010 10:25

:D thank you again jonB for the valuable info

i use dreamweaver for the basic php scripts i made. I am a student and still on the very basics of php and learning, I am going to find a better editor from the lists in the site you posted. :wink:

the next big hurdle i got to go through is connecting a database and getting it to work properly, i know i might sound silly to you'll but I use books and online resources to learn php by my self :) So, yes it is difficult for me but i will try my best. Every little bit of tips and info you give is very useful for me

thanks again :D
lrasan
 
Posts: 8
Joined: 10. September 2010 12:20


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 38 guests