whiz Posted June 11, 2006 Share Posted June 11, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11701-new-to-php/ Share on other sites More sharing options...
wildteen88 Posted June 11, 2006 Share Posted June 11, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11701-new-to-php/#findComment-44230 Share on other sites More sharing options...
whiz Posted June 11, 2006 Author Share Posted June 11, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/11701-new-to-php/#findComment-44243 Share on other sites More sharing options...
wildteen88 Posted June 11, 2006 Share Posted June 11, 2006 If you have WAMP installed then look for a folder called www in the root of the WAMP folder, C:\wamp\wwwYou 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. Quote Link to comment https://forums.phpfreaks.com/topic/11701-new-to-php/#findComment-44255 Share on other sites More sharing options...
whiz Posted June 11, 2006 Author Share Posted June 11, 2006 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\" /] Quote Link to comment https://forums.phpfreaks.com/topic/11701-new-to-php/#findComment-44269 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.