views:

334

answers:

6

I have a project that's intended to use some PHP as well as Java and Javascript, so I installed the PDT PHP plug-in for Eclipse, using the Install New Software menu option. Now Eclipse agrees PDT is installed, but no PHP features like creating or editing PHP files are appearing anywhere. Is there something else I need to do to activate PDT? (I did restart Eclipse like it said I needed to.)

A: 

Just create new project using the wizard, and choose PHP one. After Eclipse will know that your project is actually based on PHP, it will show you all the features.

In case if you have existing project, just open the PHP perspective.

Andrejs Cainikovs
That's the problem, it's not offering either a new PHP project or a PHP perspective.
rwallace
+1  A: 

Right click on your project, Configure (it's at the bottom of the list)->Add PHP Support...

After it's done, you should see a little P symbol in the project's icon.

Artem Russakovskii
Thanks, I wasn't aware of that option! But it's not offering it either, so it's definitely a case of PDT not being active even though Eclipse says it is installed.
rwallace
A: 

I've once had a similar problem. Eclipse was running with the JRE 1.4, and it seems the JRE 1.5 or later is required to run the PDT. I switched to Java 1.6 and that solved the problem.

Etienne de Martel
Thanks! But I am already on 1.6.
rwallace
A: 

I run into this sometimes with eclipse plugins.

Have you tried uninstalling it, removing the jar and files it from eclipse/plugins and eclipse/features, then installing it again?

If you don't feel like doing that. Try installing it in a clean eclipse instance and if it works then it's just a config issue with eclipse.

You might have not installed all of the tools too.

Gus
A: 

The solution I eventually came up with was to just install Aptana Studio, a PHP IDE based on Eclipse, whose standalone version can coexist happily with the regular Eclipse on the same machine.

rwallace
A: 

In order to have PHP support in eclipse project, you need to add PHPNature to the project. It's a kind of configuration paramter of eclipse project. When you craete a new PHP project using a wizard, check the .project file in a new project directory. There is a PHPNature line. Copy this line into .project of your java project. Another solution is to separate java and php code in a different projects, each one craeted by right wizard.

Vadim Punski