Jump to content


Photo

New to PHP


  • Please log in to reply
4 replies to this topic

#1 whiz

whiz
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 11 June 2006 - 10:35 AM

Hi, I just started learning php and I would like to know how to properly test or view my php file in a browser (mine is FireFox). I have PHP-MySQL-Apache installed here and my OS is windowsXP. My apache is running but when I tried to view the php file in the browser, it displays the exact code, not the would be output... Then I figured that a correct path is needed. I dunno how the path goes except [a href=\"http://localhost/<<what\" target=\"_blank\"]http://localhost/<<what[/a] next?>>. It show 404 error file can't be found. Should I place my php files in a specific folder for it to run?

Thank you in advance to those who would lend a helping hand.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 June 2006 - 10:44 AM

Your PHP files will need to be in the folder in which the APache can see, them which is most probably the htdocs folder, C:\Program Files\Apache Group\Apache 2\htdocs by defualt unless you have stated otheriwse in the httpd.conf.

When you goto [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] you should see a list of files and folders currently in your htdocs folder, if you dont but you are getting the Apache message clear the contents of the htdocs folder and you should now see a directory listing.

#3 whiz

whiz
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 11 June 2006 - 11:54 AM

I have WAMP installed (package of php5-apache2-mysql5). Under apache2, there is no htdocs folder. Should I make one? When I typed in [a href=\"http://localhost\" target=\"_blank\"]http://localhost[/a], it displayed a start page of WAMP containing my server config, tools, projects, etc., but no directory or files. The path of my apache2 is C:\wamp\Apache2\<<no-htdocs-folder>>. Am I using a different kind of apache or is there a way around this?

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 June 2006 - 01:10 PM

If you have WAMP installed then look for a folder called www in the root of the WAMP folder, C:\wamp\www

You place all your documents in the www folder and then goto [a href=\"http://localhost/filename.php\" target=\"_blank\"]http://localhost/filename.php[/a] to run that file.

#5 whiz

whiz
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 11 June 2006 - 01:52 PM

OMG it worked!! [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] Thank you so much!! Now I can go on with more tutorials here [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users