I use Eclipse with PDT, Version: Mars.2 Release (4.5.2).
I have a folder called "var" in my PHP project that I would like to exclude from build, so I excluded it in Build Path using var/**. Though, even then, it still give me errors in this folder after doing a clean/build. I also tried var/, var/* and all combinations of those. Nothing do it, Eclipse still validate those files. Those are temporary files, so it's really annoying to have the IDE working for nothing on those files.
Buld Path is for PHP validator excludes. You have couple options:
Exclude from workspace. Right click on level up dir (project) -> Properties -> Resource -> Resource Filters.
Create excludes inside project -> validation page.
Mark dir as library. When is part of build path, right click on it -> Use as library folder.
Related
Not sure how I can explain this better as I am a beginner to Eclipse application.
I have my web directory set up for php pages. For example, /home/www/phpsite. All the source files exist here.
However, whenever I create a project (say 'myProject') and test any files from the existing path, it includes the project folder in the path name:
/home/www/phpsite/myProject/index.php
and this results 'Not Found' error.
How can I run my php pages in /home/www/phpsite/index.php? The project folder name is always included in testing web pages.
I am not trying to use the workspace directory created by Eclipse. I'd like to code and modify pages directly from Eclipse to my web directory.
Thanks
Follow these steps:
Setup www as your workspace
From the menu: File -> Import -> General -> Existing Folder.....
Promote to project:
Choose project type: PHP
Browse for "phpsite" and finish.
I know how to exclude meta and log files from index inclusion but in my application's composer.json I have both Guzzle and Goutte listed as dependencies. Goutte includes a goutte.phar which in turn contains the source code for Guzzle. So when I go to use autocompletion I get this:
Is there anyway to exclude a *.phar file (or any specific PHP file for that matter) from the PHPStorm indices?
Right click on that file and select mark as -> excluded?
From the docs :
In the Project tool window, select the required .phar archive and choose Exclude phar from project on the context menu of the selection.
otherwise you can add *.phar to Settings -> Editor -> File types -> Ignored files and folders
or alternatively to Settings -> Directories -> Exclude files
I have a folder with several subdirectories containing PHP files. At the moment I open each file individually in Netbeans. However, I would like to open this folder as a project, so I can use features like searching for a line throughout the entire project. Is this possible in Netbeans? What would be the best way to achieve this?
Create a new project, set sources directory to the one you have with current files
(might want to back up the files before if anything goes wrong).
Go in Netbeans. Select Files->New Project. A window will open, in that select PHP in Categories. Click Next. In Project Name give the name of your project(as seen in netbeans), in Sources Folder select the path to your project and click Next. In Run Configuration Make the settings according to your requirement to run the project. Now in PHP Frameworks Select ypur desired framework or just leave it blank and click FINISH.
You will See your project in Netbeans now.
Go to file->New Project and select PHP in category and follow the instruction.
In Source folder you need to choose your files folder so that it get listed.
go to FILE->new Project->select php in categories in left pane and php application with existing sources as Projects *in the right pane* ->next -> next till finish
When you add any directory in netbeans as a project, it add its only directory under the project directory. So if you need to add the numbers of directory in netbeans being a project, then i would like to suggest firstly to collect all directory in parent directory. then add it as a project.
Here is an explaination:-
directory- dir
lets you have dir1, dir2, dir3, dir4.
and according to you mentioned above all dir are projects.
You have to create a dirA and all dir1, dir2, dir3,and dir4 are subdirectory of dirA.
so the folder under dirA nbprojects(created by netbeans) will take care of all directories being the subdirectory of dirA.
Is it possible, with or without plugin, to add more source folders to a PHP project, just like in a Java project?
I have downloaded and tested the Java version of NetBeans, and there is clearly possible to add more source folders. But not in the PHP version?
you can add paths for all newly created PHP projects from:
netbeans options > PHP section > Global include path
or you may add project specific include paths in a project's "project properties" (right click on a project in the projects view", and then choose "PHP Include Path" from the left side section.
although you are not allowed to edit a project included sources. you might as well create an additional project in Netbeans and call it like "my-include-path", then add all the folders in your desired include paths to this project. now you can edit your included files in this project.
When you right-click in the projects panel (Netbeans 6.9.1), there's an option 'Project Group'. This allows you to add the current projects (In this case the php and the js project) to be grouped and opened as one.
Also useful to automatically open additional projects used for reference.
Under project properties, the source folder is only one.
However, you could add folders to the PHP Include Path if you are trying to use files from another folder.
At this time, it looks like NetBeans PHP projects does not support multiple source folders.
I have added a feature request to the NetBeans' Bugzilla: http://netbeans.org/bugzilla/show_bug.cgi?id=180889
"Global include path" and "PHP include path" does not work for me.
My personal solution is to add the extra_path before the include/include_once statements in this way:
set_include_path(get_include_path() . '$extra_path);
I searched a lot, checked many times the neccesary steps, but it still don't work.
My environment is :
Latest eclipse for PHP developer package
Project is newed, not check out directly from SVN
.project has a line
<nature>org.eclipse.php.core.PHPNature</nature>
.buildpath has a line
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
.settings/org.eclipse.core.resources.prefs
has a line
include_path=0;/projectname
file ensured opened in PHP Editor
Something works:
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
Autocomplete does work for internal functios/variables such as class members
But never works for PHP core functions, neither syntax highlighting
Right-Click on your project -> Configure -> Add PHP Support...
Works for me on Eclipse 3.5 / PDT 2.1
For me, nothing worked, except:
Backup and then delete the .db files under: /.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/
Restart eclipse.
I got this tip from #4 in: http://www.nwiresoftware.com/blogs/nwire/2010/09/five-tips-speeding-eclipse-pdt-and-nwire
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.
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.
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.
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."
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?
If issue is still exists, follow the following steps:
Remove project from eclipse.
Goto your project folder and remove .Settings folder and .project
file.
Again import php project with different name.
it's work for me.
Right-Click on your project -> Configure -> Convert to PHP Project...
Works for me on Eclipse 4.6 / PDT 5.2