Migration from PHPEclipse to PHP IDE

Published on and tagged with configuration  eclipse  phpeclipse  phpide

Yesterday, I migrated from PHPEclipse (and Eclipse 3.1) to the PHP IDE (and Eclipse 3.2). After importing the projects to the PHP IDE I noticed that the Outline view (which lists class variables, methods, etc.) and the auto-completion didn’t work. Hm. The problem was that the .project file still contained references to PHPEclipse. So I had to replace:

<buildSpec>
    <buildCommand>
        <name>net.sourceforge.phpeclipse.parserbuilder</name>
        <arguments>
        </arguments>
    </buildCommand>
</buildSpec>
<natures>
    <nature>net.sourceforge.phpeclipse.phpnature</nature>
</natures>

with:

<buildSpec>
    <buildCommand>
        <name>org.eclipse.wst.validation.validationbuilder</name>
        <arguments>
        </arguments>
    </buildCommand>
    <buildCommand>
        <name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
        <arguments>
        </arguments>
    </buildCommand>
</buildSpec>
<natures>
    <nature>org.eclipse.php.core.PHPNature</nature>
</natures>

And voilà, the project was now recognized as a PHP project, and both Outline view and auto-completion worked.

Thanks to Seva Lapsha for this tip!

22 comments baked

  • kiri-

    by looking at both PHPEclipse and PHP IDE project pages I cannot figure out which would be better and why.

    currently I’m using PHPEclipse, would you please mention some features why PHP IDE is better? I’m curious, cause changing plugins can be a litte bit fumbling… :)

  • cakebaker

    @kiri: The code-completion is much better in PHP IDE. But else I noticed no big differences yet. Anyway, I didn’t switch because of the features. I switched because the PHPEclipse project seems rather dead.

    I had no problems with plugins, I installed the PHP IDE all-in-one package ;-) The only additional plugin I had to install was Subclipse, and that worked without problem.

  • CraZyLeGs

    Hmm yeah, I use PHPEclipse too..it’s not the best but I got used to it..so kinda need a reason to switch, because I’m one of these that don’t switch as long as the tool does the job.
    But I’ll give it a try

  • joelmedia

    I have used both phpeclipse and PHP IDE. the biggest difference that I noticed is that PHP IDE is a bit more sluggish.

  • Duende

    I have just switched from PHPEclipse to PHP IDE, too. And mainly for one reason: with PHP IDE, I can debug my CakePHP code. Yes, supposedly you can debug any PHP code with PHPEclipse too… but I got tired of trying.

    I’m thinking about writing a small how-to in the Bakery, something like “Debugging your CakePHP code in Eclipse”. Just let me find a moment…

  • cakebaker

    @Duende: I think that could be interesting for some people. Personally, I never used the debug functionality of those projects.

  • Dieter@be

    Hey guys check out this article http://pooteeweet.org/blog/348/p/1

    It says (among other interesting things) that PHP IDE’s debugging facilities are based on a closed source component from Zend !

  • cakebaker

    @Dieter@be: Interesting article, thanks.

  • lucaspirola

    thanks a lot, u help me!
    i am confused with this issue..
    thanks again!

  • cakebaker

    @lucaspirola: I am glad this article was useful for you :)

  • Jasmon blogi » Blog Archiv » Eclipse

    […] oli jäänyt kummittelemaan PHPEclipsen haamuja, joten homma ei tietenkään pelittänyt. Cakebakerista löytyy ohjeet, kuinka asian voi […]

  • Dario

    I tried to migrate a project from PhpEclipse to PDT and followed your suggestion (which is also officially reported here: http://www-128.ibm.com/developerworks/library/i-osource13/index.html) but my PHP Project Outline is still empty and autocompletion not working. I tried to manually rebuild the project via the Project menu but this didn’t help either. Am I missing something trivial? Any help appreciated.

    My config:
    Eclipse version: 3.2.2 (Build id: M20070212-1330)
    PDT version: 0.7 RC3 (v.20070401)
    PHPEclipse version: 1.1.8

  • cakebaker

    @Dario: Hm, did you remove the PHPEclipse files in the /plugins and /features folders of your Eclipse installation?

  • Asimov

    Thanks for this, I was tearing my hair out. By the way, another way if your not stressed to rebuild your project file from scratch, simply delete your .project file, and delete the project from within Eclipse (but make sure that the default “Do not delete contents” is selected so that you don’t lose your files).

    Then simply recreate the project in the same location as previously, and Eclipse will rebuild your project file correctly from scratch.

  • cakebaker

    @Asimov: Yes, that’s another way, but it is a bit cumbersome if you have many projects to migrate.

  • eff

    Thanks for this. I would have been searching for days. My buildSpec and natures nodes were empty by default. Strange.

  • Jimmy Forrester-Fellowes

    I’ve moved from PHPEcilpse to PDT due to PHPEclipse seems to be very unstable since upgrading my workstation to ubuntu hardy.

    One thing I really miss from PHPEclipse is the more detailed syntax highlighting palette. PDT needs to add a new colour for method names and not include them in the ‘Normal’ colour. In the following example statement I’d want ‘exampleMethod’ to be highlighted in a different colour than that used for the semantics:

    $exampleObject->exampleMethod($exampleArg)

  • cakebaker

    @Jimmy: I didn’t even notice that ;-) And yes, it seems it isn’t possible to get the highlighting you want. Maybe it will get implemented if you open a feature request for it…

  • ep

    Yeepee! I now have outline and autocompletion again!
    You save my day

  • cakebaker

    @ep: You are welcome :)

  • Stas

    I use and suggest free portable PHP IDE – Codelobster PHP Edition (http://www.codelobster.com) with special CakePHP plug-in for auto-completion, context help and etc.

  • cakebaker

    @Stas: Thanks for mentioning the Codelobster PHP IDE. Two points to add: it is Windows software, plus the CakePHP plug-in is not included in the IDE, but has to be purchased separately.

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License