I’m hoping that this will be a useful page for getting started running php code as well as solve the current problem I’m having some very simple code as follows:
<html>
<head>
<title> Practice</title></head>
<body>
This is HTML
<?php
echo "This is PHP";
?>
</body>
<html>
This is uploaded on an ec2 website which has apache running. The code isn’t interpreted, and when you view source of the page it shows the php code.
You can see the page.
Any ideas? The php code is so basic that I think it might have to do with the apache configuration. Please let me know any additional information you need and I’ll provide it, hopefully tell me how to get it to.
Are you sure you have php installed? If it is you need to make sure that apache is associating
.phpfiles with the php handler. Look for an entry similar to the following in/etc/apache/apache.confand
upon changing the file you will need to restart apache via
sudo service httpd restart