my html file in htdocs to open in netbeans ide - php

how can i open my project/files in htdocs in netbeans IDE i tried looking for tutorial but there is none..i tried import but when i do it it does not have file to open or i tried open but i did not open as well..
I downloaded netbeans here i got the last one with many checks.
i also downloaded this but i cant import it as well.
any suggestions are accepted

GO to
File>New Project>PHP>PHP Application With Existing Sources.
The browse to htdocs and select your project folder.Optionally you can set the url for your application or you can just finish it there.

Did you follow this path when opening ?
Go to
File->New Project->Select a Category->Pick one from Projects.
Let's say PHP Application with Exciting Sources. Then select your project from the next window.
Hope this helps.
Cheers!

If you are wanting to work on a live site via FTP in NetBeans I would suggest using this NetBeans plugin:
Link:- http://plugins.netbeans.org/plugin/39197/ftpsitedeployer
If you are working with local files:
File>New Project> PHP/HTML5 > PHP/HTML Application With Existing Sources.
If you are working with a GIT type repo:
Create a proejct folder then initialize the repo and then pull from the repo you can also ADD/Commit/Push/Push via netbeans IDE toolbar.

Related

How to setup Netbeans Project for WordPress Plugin/Widget Development

I am wanting to locally develop a suite of WordPress plugins and widgets. My development environment consists of Windows v8.1, Netbeans v8.0.2 and XAMPP v5.6.3.
I've configured Netbeans and PHP to use XDebug. I've spent the entire weekend watching and reading various tutorials on setting up Netbeans IDE for developing a WordPress plugins/widgets.
Everything seems to be working at this point - I've been able to create new Netbeans projects by opening existing/installed plugins of my WordPress install. I am able to set breakpoints and trace through code. All seems to be working well, but I am puzzled regarding the 'proper' way to setup a new project.
Should a plugin/widget project somehow include the WordPress core files starting at .\htdocs, or should the root of the project be .\htdocs\wp-content\plugins\myplugin? In other words, should I be able to see .\wp-admin and .\wp-includes in my project tree?
My thinking is that Netbeans needs to somehow be able to read the core WordPress files to provide function reference during development of the plugin/widget and this would require including the WordPress core in my project, somehow.
Maybe my question is best asked this way:
What should the root project folder be set to for developing/debugging a plugin named MyPlugin?
and/or:
How are WordPress core files included/referenced in the MyPlugin project?
Anyone have a good step-by-step reference that would enlighten me on this?
I'm searching for this too, but here's how I set it up. I'm developing a theme (plugin would be analogous) so I have the theme source and NetBeans project files in a separate folder outside of WordPress folder, and outside of the xampp/htdocs actually. Then, I set the root of my PHP project to this theme source folder, and then using the Project Properties -> Include Path facility to allow NetBeans to include the WordPress folder, it will appear under Include Path in Project Explorer, enabling 'IntelliSense' etc. This way you can start a new NetBeans project per plugin/theme, basically, just including the WordPress core in each. Furthermore, I have NetBeans set up to copy the source files to the xampp\htdocs\mysite2\wp-content\themes\ folder on save and project load (set up in preferences). Here's a pic: NetBeans WordPress Setup
The best way I've found so far is to use a hardlink.
If I keep the files in Netbeans' project directory everything works. But Wordpress sometimes does not recognize that the theme is there. I.e. in some wp-admin menu's. But I'm able to display a Theme just fine.
I create the project as a php project in Netbeans.
Then link my (pubic html) folder from the Netbeans directory.
mklink /J C:\LinkToFolder C:\Users\Name\OriginalFolder
Use " quotes if your path has spaces
I use:
mklink /J "C:\xampp\htdocs\wptheme\wp-content\themes\themename"
"C:\Users\Probook 1\Documents\NetBeansProjects\projectname\public_html"
Then I setup the netbeans project to load an external page when I run the project. (See File => Project Properties=>Run Configuration)
I'll be looking into doing the same with plugins soon. Practically I can't see a reason this won't work for plugins too.
I want to try and see if Netbeans copes with the hardlink better than Apache does. (I.e. if I setup the project first then move the files to Xampp and create a hardlink in Netbeans' project directory. I.e. Projectname\public_html
(If anyone does it first let me know how it goes)
It's more important to me that Netbeans can backup and function. As long as I can display what I'm developing realtime.
AFAIK Netbeans can intergrate with Xampp to run it's debugging (Xdebug)

How to download on open SFTP file in Netbeans IDE?

I'm using Netbeans 8 with remote files project.
The files are located on remote server and Netbeans access them via SFTP.
I would like that Netbeans will download fresh copy every time I open a file, same as notepad++ does.
any idea how to do that?
couldn't find solution on the web.
I ended up here after looking for an answer for the same question. I couldn't find automatic download of fresh copy during every time you open the IDE but there is an option to Download manually.
Right click on "Source Files" of your project in "Projects" window and click "Download".
If you are looking only to download files which are modified in server directly then you go for "Synchronize" which is just below the "Download".
Cheers!
You have to go on new project, and then press your java file, then make a name for your file then you are in.

Running Eclipse php project from a shared folder

I have been using Eclipse Kepler along with PDT tools on local system to manage PHP projects and its turned out to be a better choice for me then the other editors around. Only problem I've found in this environment is that content assist is only available when you open a file residing in the workspace.
Now my problem, I am assigned to work on a PHP Project which is on another system on the local LAN network. Is there any way I can add that project folder to eclipse? so that I can directly edit and save the files on the remote system?
Things I can't look into for various reasons
Using a version control system
Copy source files to local system work
on them and then upload it (kinda have to add the remote files to the
local eclipse project).
Do any modifications on the target system for my convinence eg. Adding an FTP server.
Thanks
I managed to get what I want by creating what you call a Symbolic Link in c:\wamp\www (using WAMP) folder which is also my eclipse workspace, for the network shared project I wanted to import into Eclipse. To do this open an elevated command prompt and run this command
mklink /d projectname \\network_shared_folder
/d option creates a directory symbolic link. Now, the network project will be available as a local project on the web root which can be easily imported into Eclipse (or any other IDE)
Hope this comes in handy for someone who stumbles upon this problem. Now I can get content assist for any file in the project.
Thanks.
In the project explorer if not exist create a new project then:
1) right-click the project and select New > Folder
2) Specify a name for the folder
3) click on Advanced
4) Check Link to alternate location (Linked Folder)
5) Enter a file system path, or click Browse to select a folder in the file system.
6) Click Finish
Check here for more Creating Linked Resources on Eclipse
After hours of searching, I share the solution finally found: symbolic links are not usable if the project is managed via git.
Another solution is to use the fileSync plug-in (http://marketplace.eclipse.org/content/filesync) to automatically copy folders from the source project to user projects.

Navigate XAMPP htdocs Files using PHP - Eclipse

I'm just starting with wordpress tutorials and I am not familiar in using Eclipse-PHP. It seems like eclipse is easier than notepad++ as editor so that i want to learn how to use eclipse editor.
My problem is its quite pain in the ass figuring out how to just simply navigate my files Using Eclipse. How can I navigate my XAMPP files using PHP-Eclipse.
The picture below shows the expected output on navigator window:
I'll use this to auto update my htdocs files in my localhost server in xampp.
I see the link here which gives the instruction to switch workplace but i don't get how to browse the files with the categories below:
Please help me with this and i'm about an hour exploring php eclipse.
Your help will be greatly appreciated for a starter like me.
In Eclipse you create "projects" as opposed to browsing the entire filesystem. So in this case let say you had a blog to work on that you have in htdocs/theblog.com.
You would right click on the project explorer window and "Create new project" then choose the appropriate project type - in this case PHP. Then you would select the option that says use an existing location and browse in typical fashion to htdocs/theblog.com. Then proceed through the rest of the wizard. and finish.
Eclipse will then index the project and run a series of validators and stuff... essentially "building" the project. After that you will see the project in the project explorer pane. You can repeat this for all your individual projects.
Like wise you can close and open projects to keep them out of the way when youre working on one or another.

How to create Eclipse project from existing git repo

I have an existing project utilizing git and have just installed eclipse along with egit. I pointed to the git repository with egit and can see all my files, my existing branches and can switch between branches.
When I open a file from the view of the git repository it does not seem to recognize that it is a php file, doesn't show me the classes within it and doesn't do code completion. If I just drag a file in from explorer it at least recognizes that file as php, but doesn't understand the project well enough to show me code completion from installed libraries. I think I need to configure eclipse to understand the projects home directory, but am a bit lost. Any help would be appreciated.
Your answer may fall within this guide to change the "nature" of your project. It's at least worth exploring. I will be attempting to do the exact thing you've described some time this week so hopefully it will work. The wiki doc also suggests that certain "natures" may conflict with each other but hopefully that won't be the case here. Link -->
http://wiki.eclipse.org/IRC_FAQ#How_do_I_manually_assign_a_project_Nature_or_BuildCommand.3F
After just trying to reproduce your steps I am having the exact same experience. I believe this may be "expected" behavior. For clarity, when I open a php file from the "PHP Explorer" view everything seems to work fine but when I open a php file from the "Git Repositories" view Eclipse treats it as a text file (no code highlighting etc.). I suggest that you work from the PHP Explorer view and leave the Git Repositories view open separately only to watch/monitor the repository not as a working view of files to edit and what not.
You need to open it as a PHP Project from existing source (GIT working folder) then share the project with Git, ie, right-click on the project, go to Team > Share project, click on Git.
See http://www.youtube.com/watch?v=-Zba8iAnLms for a demo.
Did you install the pdt plugin in eclipse? It should recognize any .php file opened. Shouldn't matter where it's located.

Categories