phphtmlaptanaaptana3

Aptana Studio 3 doesn't recognize PHP inside .html


When implementing code like i.e.

<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?>

</body>
</html> 

https://i.sstatic.net/DleAX.gif

Next to <?php it gives red X icon with error that "<" missing '>' for end of tag. I did find some older threads about this here at stackoverflow, but there wasn't really any solution or response at all. I tried the solution of adding PHP Source Editor for .html and setting it as default, but looks like it doesn't work.

It's not a deal breaker, it's just I don't like red icons and false errors throughout the code.


Solution

  • The title of your question suggests that you are saving the files as .html

    If this is the case then there will be an error as Aptana will not be looking to validate <?php ?> tags. If I'm right then you will need to save the files as filename.php and not filename.html.

    If this is not the case then you might want to change the title slightly.