PHP not working with WAMP

Hi,
I have installed WAMPServer from http://www.wampserver.com/en/
Apache : 2.4.9 MySQL : 5.6.17
PHP : 5.5.12
PHPMyAdmin : 4.1.14
SqlBuddy : 1.3.3
XDebug : 2.2.5

PHMyAdmin is working and I can gte phpinfo() page.
I am able to access the Apache server at localhost.
I created a directory at C:wamp/www/test
and put there a file called test.html which has HTML, PHP and JavaScript.
test.html

<html>
<p>
Hello world!
</p>
<a href="http://www.google.com">search</a>
<?php echo "hiya"; ?>
<script>
alert("hey");
</script>
</html>

The HTML and JavaScript are working fine but the PHP echo is not.
Any help would be appreciated.
Thanks,

I think you have to name your files with the .php extension, not .html, in order for it to run it through the PHP engine. At least out of the box, anyway.

The simplest means of testing whether php is working or not is creating a file named index.php with the below content.

<?php phpinfo(); ?>
1 Like

Yes that was the problem. I renamed the file test.html.php and it works fine now.
Thank you both,
Shane

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.