Jump to content


Photo

Where do I save php files in WAMP?


  • Please log in to reply
4 replies to this topic

#1 Lee

Lee
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 September 2006 - 02:59 PM

Hi everyone I'm also brand new to php  :-\

I have just installed WAMP5, used localhost during install, & localhost is showing all the right info.

I'm learning from the 'php for dummies' book & made a php file with the following code..
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<?php
echo “<p>This is a PHP line</p>”;
phpinfo();
?>
</body>
</html>

I know this is info is already available from localhost, but where would I store this file to make it work?

Thanks.

#2 wildteen88

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

Posted 20 September 2006 - 03:05 PM

Look for the WAMP installation directry which I think is located in the root of the hard drive - C:\WAMP - look for a folder called htdocs or www within the WAMP folder. You put all your php files in the htdocs or www folder. You can then access these php files by going to http://localhost/filename.php

#3 Lee

Lee
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 September 2006 - 03:15 PM

aahh I see, I was just going to the www directory & opening the file. I didn't realise I would need to use http://localhost/ in the browser.
I assume I will do this with every file I create now then..

Thanks mate!! ;D

#4 wildteen88

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

Posted 20 September 2006 - 03:37 PM

Yeah that is correct. PHP runs on the server, thus you had to instal WAMP. You cannot run php files like you can when you double click a html files and it opens up in IE. PHP is not a lanaguage the browser understands, as PHP is a web programming langauge. HTML, CSS and javascript are client side lanagugaes which the browser understands. PHP generates the output which will be mainly text/HTML from your code.

#5 Lee

Lee
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 September 2006 - 03:43 PM

Yeah that is correct. PHP runs on the server, thus you had to instal WAMP. You cannot run php files like you can when you double click a html files and it opens up in IE. PHP is not a lanaguage the browser understands, as PHP is a web programming langauge. HTML, CSS and javascript are client side lanagugaes which the browser understands. PHP generates the output which will be mainly text/HTML from your code.


Aha, thats another penny that has now just dropped! Thanks again  ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users