Eclipse 2019-06 PHP autocomplete (content-assist) not working - php

I've juste installed the latest version of Eclipse, Eclipse 2019-06.
Infortunatly, the PHP content-assist or autocomplete doesn't work anymore when working on remote system.
I've searched for solutions but didn't find anything...
The files are on a remote workspace, not local. It was OK with and old version of Eclipse (Mars), there are illustrations above.
I've checked in the preferences at PHP->Editor->Content assist, the Auto-Activation is checked.
Here is an illustration :
https://ibb.co/MD72NKv
With an old version, it worked well :
https://ibb.co/R7xQShL
Thank you in advance !

OK the problem is solved.
It occured only with files on remote system, not on a local file in the workspace.
Thi solution here work perfectly :
https://drupalsun.com/patrick/2011/07/25/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins
Now we are going to use RSE to edit an eclipse RSE .project file. So in your 'Remote System' tab open up your local files and navigate to you workspace folder. Look for a folder called 'RemoteSystemsTempFiles' and open that. Now you are going to edit the '.project' file. Open up that file.
You are going to add two line in between the <natures> tag, those lines are
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.php.core.PHPNature</nature>
Save that file and restart eclipse. If you did everything correctly you should now have auto complete that will look like so

Related

netbeans 8 does not refer to the actual PHP file path, when running a PHP file

I have installed php, mysql and nginx properly.
I am able to run the PHP pages from Eclipse, i.e Eclipse opens up chrome, and pages are displayed correctly.
I imported my existing PHP project into Netbeans.
When I try to run any of the php pages, netbeans opens up chrome, but the web address is always the same, and not the real path of the PHP file.
Why netbeans refers to the same location, instead of trying to run the file from its real path? how can I fix it?
Thanks,
Qwerty
I found the solution.
The green "play" button in Netbeans does not run the current file, but runs the PROJECT! This caused eclipse to run the project path instead of the current file location!
Therefore, in order to run the current file click on "Run -> Run File" (Shift +F6), and then it works.
Just make sure that the project path is set properly in "Run->Set Project Configuration -> Customize", and then set the project URL to:
http://localhost/
That`s it!
Thanks,
Qwerty

NetBeans is not creating folder in localhost XAMPP for php project in Mac

I am starting to work in PHP project with NetBeans and XAMPP. I am using the option "Copy files from Sources Folder to another location" to have he files available in my local host. The problem I am facing is NetBeasn is not creating any folder but it is not giving any message error.
I have followed the instructions in NetBeans site and also I have performed some searching in internet to find a solution but nothing is working.
I have checked the correct project settings, and if I try to create a folder in a differet directory (for example Docuements) NetBeasn create the folder without any problem.
I have reviewed the folder permissions and these are ok too. Also I have changed the settings for the subfolders.
Any one have a clue to solve this issue?
I am using NetBeans 8, OS X Maverick
Try opening Project Properties in NetBeans and check "Copy files on project open". Then "run project" from NetBeans.
This might solve the problem

Netbeans with xdebug not highlighting debugged lines

I finally managed to get xdebug working but now I am facing a strange problem. I can see the variables, I can step through the code but i can't see what line I'm actually debugging. Any ideas?
If you don't see highlighted lines, it's possible that the project settings aren't configured correctly.
E.g. when using a htaccess redirect from the root folder to folder myapplication, be sure to edit Project->Properties->Sources->Web Root to the redirect folder.
That solved the issue for me.
Under Netbeans > Project Properties > Sources, be sure that the Web Root is set right to refer to the directory where the running page is. This could be one of the possible reasons of the problem.
I ran into this same issue, and it was because I did not set up Path Mapping in the project.
Project -> Run Configuration -> Advanced
More info here: https://blogs.oracle.com/netbeansphp/entry/path_mapping_in_php_debugger
In my case what seems to have fixed the problem is to right click the file (in my case a java file) choose "select in projects" then it asked me if I want to open the project (actually this is what I think was happening, I had the file opened but not the project), I said yes and then netbeans started to show me the line as it goes debugging.

how to run php script in phpeclipse

I was downloaded the phpeclipse from the eclipse downloads.
i have wamp in my machine(c:/wamp/).
i set path like c:/wamp/php/php.exe in system environmental varariables path.
now i want to run php script from phpeclipse.
what i have to do to run php script.
is there any runconfigurations in the phpeclipse.
if exists...how can i configure those things?
is there any documents exists related to that?
is anybody explain me in detail?
thanks in advance.
regards
kk
In order to run your php project in Eclipse you need to edit the server configuration in the Eclipse . do the following .
In Eclipse Go to Window->preferences
On the left panel you see PHP expand the tab click on PHP Servers
On the right side you will see Name as Default local host with url click on it and edit it
A pop up will appear you will see two menus Server and Path Mapping click on Path Mapping
Enter the Path of the virtual directory ie path of wamp www directory , if you are on linux just enter /var/www.
Finally run the project
Hope it helps !

Why does Eclipse code completion not work on some projects?

I have Eclipse 3.3.2 with PDT doing PHP development.
All projects that I create, even SVN projects have code completion.
Now I just opened another SVN project and it has no code completion or PHP templates (CTRL-space does nothing in that project).
However, I can open the other projects and code completion all work in them.
Why would code completion and templates be "off" in just one project and how can I turn it back on?
Maybe Eclipse doesn't understand the project has a "PHP nature".
Try comparing the .project file on both projects to look for differences. It should contain something like:
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
</natures>
The .project file will be in your workspace under the project directories.
Look out for the file .buildpath in your project... put this line between the tag:
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
Save it and restart eclipse. Now everything should be OK... This worked for me. :)
Thank you!
I spent all day long to figure out why I did not have code completion...
The problem is that if you create a SVN project the .project is a basic file without codecompletion reference. You have to create a basic PHP project and compare the two files and replacing the missing part in the SVN project one.
Now I have code completion for every file in the project, even for Zend Framework library
It is just one line to add in the .project file and then restarting eclipse to get codecompletion:
Where it says
---
<natures>
</natures>
---
after the change has to be
---
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
</natures>
---
That should do.
#Guido PHPNature does not fix this.
#Edward Tanguay Yes, that's because when you create new PHP project, eclipse adds .buildpath file with
<?xml version="1.0" encoding="UTF-8"?><buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/></buildpath>
when you import existing project you eclipse does not generates .buildpath file, but you can add it by hand or create new PHP project with existin source (you can choose in wizard).
I have the same issue sometimes. For me it works to rebuild the PHP project with "Project" -> "Clean".
If you have this problem, follow these steps :
Select "PHP Include Path" in your project tree
Right click on it then click "Build Path>Configure Build Path"
On the opening window,add folder that you want to build, so it can do code assist.
Thats all :) I hope it resolves your problem, I solved my one :)
Be sure the file opens with the "PHP editor". Right-click the file, and select open with to select the right editor.
If it turns out you've been using the wrong editor, you can change the association under Preferences » General » Content Types
Right click in the edit screen, goto Java -> Editor -> Content Assist -> Advanced ...select proposals accordingly
ATTENTION
Besides the already mentioned solutions to get the whole autocomplete help to work, there is another quirk: it might not be enabled.
Go to Window > Properties and then to PHP > Editor > Code Assist (JAVA has a similar option) and set "Enable auto activation", preferably with a delay that you see comfortable (0ms). If you are bothered by the program suddenly deciding to do things for you without prompt (and doing it wrong), deselect "Insert single proposals automatically" and you should be fine.
I've noticed sometimes when you checkout a project from svn in eclipse (subversive or subsclipe "checkout a project as") and even though you check it out as a php project it will either delete the .project file or it would be a generic project. I've found to just go in that directory and delete the .project .settings/ and .cach/
Then create a new php project and point the directory where you checked out the files. And you should have code completion and svn should be link to your repo.
I had a problem that build path was empty, so no code completion for any of the files i tried to edit. Make sure you setup properly your build path, especially if you're linking the source from some other location than the workspace.
Like the apache htdocs folder for example.
I have solved this by enabling the Full C/C++ indexer (Windows-> properties -> C/C++ -> Indexer), and also hit the radio button "Use active button configuration". After that Clean, and Build all.
That worked on Eclipse CDT 3.4
If you came here looking for code completion in php eclipse not working, make sure your project is being supported as a php project. Right click on the project and then go to configure -> Add php support. If you have the right settings for code assist it should work instantaneously. Sometimes newbies as me tweak around with the projects or start projects as clean and not as php so eclipse doesn't know how to treat the project.
I had to right click the project in the PHP Explorer, go to "PHP Build Path". This was empty. I clicked "Add Folder", selected the checkbox next to the root folder of my project and clicked "OK", then "OK" again.
After that code completion seemed to work. Should just work out of the box if you ask me, but whatever.
Check the lib of your project. It may be that you have include two such jar files in which same class is available or say one class in code can be refrenced in two jar files. In such case also eclipse stops assisting code as it is totally confused.
Better way to check this is go to the file where assist is not working and comment all imports there, than add imports one by one and check at each import if code-assist is working or not.You can easily find the class with duplicate refrences.
One solution could be to include a dummy php file wich requires all your PHP classes. So that the PHP parser recognizes these classes too.
Example dummy file:
if(false) {
require_once 'class/one.php';
require_once 'class/two.php';
require_once 'class/three.php';
}

Categories