EDIT: To answer some of the comments - the file extension is .php, the perspective is PHP, and it is in a PHP project. I can't use different tools because this is a school project
I have Eclipse with Web Tools (so I can do web projects with JSP). I also have to use Eclipse for my PHP development (I am using it with XAMPP, if that matters). (Two different school projects.)
I have installed the plug in for PHP (in addition to XAMPP, which includes PHP itself) and it appears to work, in that I have a PHP perspective and can create a new PHP project. However, even when doing something as simple as the below, it doesn't work. Eclipse does not recognize the php tags at all.
Does anyone have any ideas what I'm missing?
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
ok - on a whim I decided to look for menu options that might help. And I chose Project > Clean, which rebuilds from scratch. It suddenly works!
I don't know what happened, but apparently, it was an old error that I had fixed with the right plug-in info and I just needed the project to rebuild.
Thanks for the ideas, though!
Maybe change your current Eclipse perspective into PHP?
I believe Eclipse chooses the appropriate editor (and highlighter) based on the extension of the file you're editing. Try using .php or .phtml if you can.
You have to configure the "Content-types" in Eclipse, to associate the extension of your file with the PHP editor.
This can be done in Window > Preferences > General > Content Types > Text > PHP Content Type : here, you have to add the extension of the files that contain PHP code.
Here's a screenshot of what this looks like on my current installation :
(source: pascal-martin.fr)
If you want to use the PHP Editor for one specific file, without associating its extension with the PHP Editor, you can also right-click on the file's name, and choose the right editor in the Open With menu.
I think you'd better use www.aptana.org for editing web pages. Aptana is really cool in this.
If you want to keep your existing Eclipse build you can also add Aptana as a Eclipse plugin or Aptana as a standalone as @FractalizeR has suggested.