28

I searched a lot, checked many times the neccesary steps, but it still don't work.

My environment is :

  1. Latest eclipse for PHP developer package

  2. Project is newed, not check out directly from SVN

  3. .project has a line

    <nature>org.eclipse.php.core.PHPNature</nature>
    
  4. .buildpath has a line

    <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
    
  5. .settings/org.eclipse.core.resources.prefs has a line

    include_path=0;/projectname
    
  6. file ensured opened in PHP Editor

Something works:

  1. PHP core function defination displayed when mouse over, and Ctrl+Click will open its defined file, but input 'arr' nothing happens, while a list of array functions expected
  2. Autocomplete does work for internal functios/variables such as class members But never works for PHP core functions, neither syntax highlighting

9 Answers 9

30

Right-Click on your project -> Configure -> Add PHP Support...

Works for me on Eclipse 3.5 / PDT 2.1

Sign up to request clarification or add additional context in comments.

6 Comments

ever checked this option, it's gray
wow thanks, this worked for me on Galileo, it's a pain to work without autocomplete for core features
I don't see a 'configure' option when I right-click my project in Helios
Don't forget to add <?php ?> tags too!
After you install support for PHP, restarting wasn't enough for me - I had to close any already open files in the editor and then restart and re-open them for the syntax highlighting to work (Eclipse Luna)
|
22

For me, nothing worked, except:

  1. Backup and then delete the .db files under: /.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/
  2. Restart eclipse.

I got this tip from #4 in: http://www.nwiresoftware.com/blogs/nwire/2010/09/five-tips-speeding-eclipse-pdt-and-nwire

3 Comments

Worked great, just by deleting the .db files and restarting. Thanks
Worked for Eclipse 4.3 when the add PHP support option was disabled.
Excellent advice. Does anybody know how and where one would trigger such an reindexing of DLTK within Eclipse? Helped me big time with Eclipse Kepler and PDT 3.2.0! thx
15

As noted before the 'natures' node for php core is listed but this is most insufficient when the project is imported or checked out.

  • Make a backup of your .project
  • Remove the 'natures' node children
  • Close/Re-open eclipse
  • Right-click project -> Configure -> Add PHP Support
  • Add back other 'natures' children

The issue is that project will not make the necessary imports because it assumes it already has.

1 Comment

Right-click project -> Configure -> Add PHP Support is always grayed out for me?
2

Nothing helped, but this:

In Eclipse:

Go to Window -> Preferences -> General -> Editors -> File Associations

Click Add

Type *.php

Under Associated Editors choose PHP Editor and click Default on the right.

Close and open your php file.

Comments

1

There are 3 .dll files: model.h2.db, model.lock.db and model.trace.db under workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2

Remove these files and restart Eclipse.

Comments

0

There seem to still be a lot of bugs related to auto-completion for the PHP Development Tools Project (PDT) (See Open Bugs).

One has been entered two days ago: bug 286733 "When using sub namespace completion does not work."

alt text

But this is hardly the only one:

  • "Autocomplete on namespaces failed" (bug 281766)
  • "[php 5.3] Code assist doesn't provide method completion" (bug 286068)
  • ...

They are all related to the namespace of the PHP code. Could you check if you reproduce the error in a global namespace?

1 Comment

not this one, in my project (no namespace specified), also tried a clean PHP project, autocomplete does work for class members, just no effect when input core functions.
0

If issue is still exists, follow the following steps:

  1. Remove project from eclipse.

  2. Goto your project folder and remove .Settings folder and .project file.

  3. Again import php project with different name.

it's work for me.

Comments

0

Right-Click on your project -> Configure -> Convert to PHP Project...

Works for me on Eclipse 4.6 / PDT 5.2

Comments

0

For those who are struggling with making it work with FTP/SFTP remote files opened using "Remote System Explorer (RSE)" plugin, just go to

Window > Show View > Project Explorer then Right click on "RemoteSystemsTempFiles" > Configure > Convert to PHP Project

like @ino wrote in this comment

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.