WAMP
Posted by: Brenton (---.126.125.91.dyn.plus.net)
Date: July 19, 2012 02:08PM

I've done a fresh install of VISTA, downloaded WAMP 2.2e, installed WAMP and get the icon in the systray, when I click on the 'Localhost' in the menu, I get the 'Server Configuration' page, If I click on the link, 'PHPMYADMIN' all I get is, the website declined to show this page. If I click on the PHPMYADMIN link from the menu, I get the same page, If I try to run a 'PHP' file initiated from a HTML file, all I get is the PHP file opening up in NOTEPAD. I tried a PHP form script some time ago and got it to work before any of the above was installed, I then uploaded to my web site and it still works All I would like to do is use my VISTA machine as a test bed before uploading to the web site, For two months I have been pulling my hair out trying to get this to work, I've trawled the internet, checking numerous forums for possible answers but none that were applicable or worked.
I would apreciate any advice/information on being able to resolve this, I have never used or been able to use WAMP before, I hope there is some one out there that can help?

Options: ReplyQuote
Re: WAMP
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: July 19, 2012 03:38PM

Ok lets try and sort out the easy ones first:

If you want to run php scripts then with the 'out-of-the-box' configuration of apache the file extension has to be .php. If you have files with the .html extension apache will server them to the browser BUT NOT pass them through the php interpreter and will therefore server them to the browser AS-IS. and you see is the raw code.

If you are getting the file opened up in NOTEPAD then I assume you are using explorer (file manager) and clicking on the .html file. This wont work, you must put the address into Internet Explorer or it wont go through your apache web server at all.
i.e.
 [localhost]

This means that code you want to test should go in the c:\wamp\www\ structure

It is much recommended to create subdirectories under that so for example
C:\wamp\www\site1
C:\wamp\www\site1
Then you dont run the risk of messing up a bit of wamp code !!!


The PHPMYADMIN problem

Can you check your hosts file.
c:\windows\system32\drivers\etc\hosts
It does not have an extension and to edit it you must be in Administartor mode.
right click over your editor icon or notepad and select the "Run as Administrator" option from the menu.

comment out all entries other than ( comment is a # in column 1 )

127.0.0.1 localhost




If you still have problems post again.

Options: ReplyQuote
Re: WAMP
Posted by: Brenton (---.126.125.91.dyn.plus.net)
Date: July 19, 2012 10:24PM

First of all let me thank you for your response, it was much appreciated, with regards to PHPMYADMIN, I tried typing in the address bar, [127.0.0.1], and managed to get to the correct page, I then received your response and checked the HOSTS file and sure enough, there was a number of entries reading '127.0.0.1 localhost' and one entry of '::1 localhost' I changed this to '127.0.0.1 localhost' and sure enough the link from the menu now works as does the link from the 'Server Configuration' page. With regards to the other issue of PHP, I have created another folder within the 'WWW' folder but I am still getting the raw data. Just to try and clarify what I was trying to do, I'll include the lines from the HTML file which reads,

<form action="contact.php" method="post">
Your name<br>
<input type="text" name="cf_name"><br>
Your e-mail<br>
<input type="text" name="cf_email"><br>
Message<br>
<textarea name="cf_message"></textarea><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>

The contents of the PHP file:

<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];

$mail_to = 'brenton123@hotmail.co.uk';
$subject = 'Message from a site visitor '.$field_name;

$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to brenton123@hotmail.co.uk');
window.location = 'contact.html';
</script>
<?php
}
?>

This works perfectley well on the web site (Hosted).
Which is why I cannot understand why it is not working outside the hosted web site. Is there something simple I am missing or is there a specific way to make it work under WAMP?
Once again I thank you for your response.

Options: ReplyQuote
Re: WAMP
Posted by: stevenmartin99 (Moderator)
Date: July 19, 2012 10:29PM

ye its simple.


mail doesnt work unless you own a mail server.

php just pushes the request to the mail server. - so it wont work

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: WAMP
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: July 19, 2012 11:39PM

RE: Windows does not come wit a mail server

Try looking for hMailer, its a windows mail server, not so easy to configure but it does work really nicely when you get it sorted.


An easier solution would be phpMailer

[www.askapache.com]

Options: ReplyQuote
Re: WAMP
Posted by: Brenton (---.108.112.87.dyn.plus.net)
Date: July 19, 2012 11:40PM

Hi, I do have a mail server, when I try it with the co-responding email address, I get the same result, the code showing in IE, I did have it working before which is why I uploaded to my web site?

Options: ReplyQuote
Re: WAMP
Posted by: Brenton (---.108.112.87.dyn.plus.net)
Date: July 20, 2012 12:18AM

Hi, Just tried a tutorial on TIZAG.com, nothing to do with mail, exactly the same thing is happening. IE shows the PHP code?

Options: ReplyQuote
Re: WAMP
Posted by: stevenmartin99 (Moderator)
Date: July 20, 2012 12:39AM

you using localhost?

and file is called .php and not .php.txt?

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: WAMP
Posted by: Brenton (---.108.112.87.dyn.plus.net)
Date: July 20, 2012 12:55AM

Yes I'm using 'localhost'

I tried both, file created in NOTEPAD and saved with .PHP extension, also tried creating file in MS Expression Web and again saved file with .PHP extension?

How do I check that PHP is installed and correctley installed, ie; configured?

Options: ReplyQuote


Sorry, only registered users may post in this forum.