Create New PHP Project in Eclipse - php

I want to create a new PHP Project in Eclipse but I found no PHP Project Option after clicking File > New >.
What should I do to create a new PHP Project in Eclipse Juno?

You need to install the PHP Development Tools package for Eclipse. From the link given:
In Eclipse, click Help -> Install New Software and work with *: http://download.eclipse.org/tools/pdt/updates/3.5
Once you have installed the plugin, you should be able to create a PHP project.

Do you install PDT? See this: http://www.eclipse.org/pdt/

You probably are on Java Perspective, whre "new PHP project" item isn't contributed. Use File -> New -> Other (ctrl+n shortcut) and select php project from list.
Off course Eclipse PDT have to be installed.

At the time of this writing, June 2018, the URL to download the plugin is:
http://download.eclipse.org/tools/pdt/updates/5.3
This will become outdated over time so anyone reading this post in the future should just check...
https://www.eclipse.org/pdt/
...for the current version.

Related

using TFS for non-Microsoft Projects

I work for a shop that has standardized on TFS. We have one project that was developed by a subcontractor in php. You can't even load this thing in Visual Studio.
I managed to create a repo for the project, but I need to find out how to check the project in. Is there some other app (like tortoiseSVN) that I can use to check stuff in and out without Visual Studio? Or is there some way to get VS to load the project and check it in and out without creating a .sln, .csproj, or any other unwanted files?
Actually, it's totally possible to use Visual Studio to do this.
You can use the web interface to create a repo...
You can't edit the php in Visual Studio of course, but you can open the Source Control Explorer to check the project into the repo.
You need to remember to go in Visual Studio to check files out before you edit them, and then check them back in when you're done.
It's clunky, but not as clunky as buying a $200 per year setup we're only going to use a few days out of the year. We're a Microsoft shop after all.
I'm assuming you're using TFVC and not Git for version control.
If you don't have Visual Studio at all, you can install Team Explorer. If you already have Visual Studio installed, that's fine too.
The tool you're looking for is tf.exe -- it's the command line tool for interacting with TFVC.
You can also consider using a Git repo instead of TFVC for this -- although TFVC can be used for any type of source code, it has a reputation of being exclusively for Visual Studio-based projects. Git is likely to be more familiar to folks who have never worked with TFS or TFVC and have not spent much time using Visual Studio.
You can use PhpStorm, then install the TFS Integrartion plugin for it, then you can manage the php projects in PhpStorm same as manage projects in VS.
Just follow the steps mentioned in below screenshot to configure the PhpStorm:
More information you can refer to Using TFS Integration.

Use symfony framework with Eclipse PDT

I am begining a project in PHP that needs a framework. I've looked in vain for how to install either Symfony or Zend plugin for Eclipse, my IDE.
Any useful links or indications, please ?
http://symfony.dubture.com/installation/
But the best support Symfony in PhpStorm, look at the gifs: http://plugins.jetbrains.com/plugin/7219?pr=phpStorm
I also use PHP Storm at work but I'm just too cheap to buy it for home, so I use Eclipse with the Symfony plug-in! You can download it from the Eclipse marketplace for free, though it is only for Symfony 2.0, Symfony 2.5 is recognized, there are just a few features missing. I found that it still can be useful for code hinting and many Symfony-related helpers still pop up. It beats no helpers or hinting but it does lack many intuitive and time-saving features found in PHP Storm.
Anyway, here's the link directly from the Eclipse plug-in page: http://marketplace.eclipse.org/content/symfony-plugin
If you have Eclipse open, you can even just drag and drop the "Install" icon directly onto Eclipse and it should install automatically. Best of luck to you, #sk001!
I've found a solution.
Either for Zend or Symfony, to use it in eclipse PDT, you need first to download it from the official web site (zend's latest download page, Symfony's download page). Then, add the library to eclipse (Window -> Preferences -> PHP -> PHP Libraries and then new, navigate to the downloaded directory). Finally, after creating the project, right-click on it, Include Path -> Configure Include Path -> Add Library -> Choose User Library then next and select the needed libraries.
For Yii framework, you need to install the Yiiclipse plugin for your eclipse PDT.
I hope it'll help somebody.

Zend Studio 10 How to use SVN

I am newbie in using SVN so this is my question.
I don't know how SVN really work but I want make new repository like here this were explained:
http://files.zend.com/help/Mobile/Zend-Studio/Advanced/content/configuring_an_svn_connection.htm
I don't know what should be in URL
I paste there path like:
file://F:/wamp/newSVNProject
newSVNProject - is empty folder where I want to make new SVN project
I was installed SVN in Zend Studio in "welcome page" but I don't know what to do next, how create my own SVN repository with the project? sorry for my english ;-)
I use wamp and I work local
You cannot create your own SVN repository only through the Zend PHP Studio.
What you've installed is the IDE connection to SVN and NOT a SVN server.
You will need to connect to an external (to your IDE/environment) SVN server.
There is a perspective in Eclipse that is used for adding/managing added repositories - it is called "Repository Explorer". You can add a Shortcut to if from the upper right corner of out IDE's window.
If you want to install an Subversion (SVN) Repository you will need to do totally different configurations. The easyest way is to provide the versioned content through a web server - like Apache.
You can read all about it in the Subversion Book.

Eclipse PDT + Code completion not working at all

I wanted to start a new Zend project, and currently I'm facing some issues regarding Eclipse PDT... My problem is, that the code completion in Eclipse for PHP does not work at all.
I tried a lot of different tutorials etc, for example making a new project and import the files; making a new workspace and import projects there; almost every possible combination of buildpath settings and library imports; deleting several files in .metadata (you will find lots of tutorials like this if you google for it), but nothing worked.
[Edit] Also the PHPNature is set (thanks to tranisstor):
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
(It also does not work if there is only the PHPNature set, and no other in addition)
[/Edit]
The problem in detail: I made a new Zend project, and tried to start coding in the IndexController.indexAction(). First thing I did: I typed in $this->, but no code completion came... I thought maybe I would need to add the Zend library, which I did. When I click into the Zend_Controller_Action in class IndexController extends Zend_Controller_Action I can see the documentation of Zend_Controller_Action, I also can press F3 and the corrosponding file will appear... Which means, Zend is successfully added as library.
I also tried Ctrl + Space, but just nothing happens. By the way, the standard PHP functions like isset() also won't show up in code completion
Does anybody have a idea how to fix this? I am using Eclipse Juno, with Eclipse PDT 3, and Zend Framework 1.x (don't know exactly, but it's not ZF2 and it works well if I open http://localhost.
I'm grateful for any help
I had the same problem when upgrading eclipse to Kepler. The following worked for me:
Remove files under workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2
The reason was that the workspace old DLTK index is not compliant with the new version and needs to be rebuilt. Start eclipse and the DLTK index will be regenerated.
Code completion worked for me again after that.
i feel you, i had to deal with this quite often too, and the mentioned .project file modifications didn't do the trick.
What helped me was this:
edit the .buildpath file and add
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
My complete build file might then look sth. like this:
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
i also added my folder which contains the php files to the build and include path (RMB over the project), but i don't think that it was necessary, the most important part was the modification of the .buildpath file for me.
Hope that helps...
The standard solution (at Eclipse forum) didn't work for me. What fixed this problem was the following:
going to Properties for my project (right click on it in PHP Explorer, then Properties),
select PHP Build Path/"Add Folder"
in there I ticked/selected my project's main folder.
It took a while while the DLTK database was refreshed (it could block your machine for a couple of minutes, be patient) but then it started working great.
Remove workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/*. It should works.
Hope it helps!
I think this is the best way:
Right click on you project in the project Explorer » Configure » Add PHP support...
Maybe you need to edit your .project-File and add a "PHP nature" tag. See this thread for more information. I once had this issue after putting a project under svn version control and it seems to be a common problem.
I've found a sollution on eclipse forum. Downgrading to PDT 3.1.2 solved the problem.
Regards,
Marek
I had a similar issue, but involving just one PHP file. Then I found that I was using the following syntax for the initialization of a variable inside a method:
$rule = ($fullValidation)?(new StartTimeRule()):(new NullRule());
The problem seems to be the use of the inline condition. The code was working but apparently broke some Eclipse features, like the F3 command, autocompletion, the outline view, etc. I could be wrong, but I think this is a bug of the DTLK indexer.
I changed that line with a standard if statement, not an inline condition, and all the features now work again.
Hope this can help!
After trying the other possible solutions on this page, I managed to get code completion to work in PDT 3.2 with the latest Dynamic Languages Toolkit in Eclipse Juno.
Juno usually installs DLTK version 4.0 by default so I downloaded DLTK 5.0 from here: http://download.eclipse.org/technology/dltk/downloads/drops/R5.0/R-5.0-201306060709/. Use the Core Frameworks > EMF > Runtime Version link, which downloads a zip file so you will need to do a local install:
In Eclipse select Help > Install New Software > Add > Archive > navigate to the zip file > type DLTK in the Name box and confirm.
Use Eclipse's Install new software to get PDT 3.2 from the PDT repository, if it is not already installed: http://download.eclipse.org/tools/pdt/updates/3.2/release
Option 2: Before I tried the previous method I installed PDT 3.1, which I got from the Juno update site (instead of the PDT repository):
Install New Software > http://download.eclipse.org/releases/juno. Code completion worked in 3.1, so it's another possibility.
Download ZF2 and put it to your perefered Location (~Frameworks/ZF2)
Eclipse: Window > Preferences > PHP > Libraries = Push "New"-Button, add a Name
choose added Item and click "Add External Folder"-Button. Choose you ZF2 destination
Be sure, your Project is "PHP Project" (see: Mark Project-Base-Folder, click Project in Menu > Project Natures and choose PHP Project.
This will rebuild your Project, if not also choose Project > build Project.
Now all should work like a charm (on Kepler Service Release 2)

PDT autocomplete broken in Eclpise

Suddenly I can't use autocomplete in my Eclipse PHP projects.
When I press alt+/ I jsut hear a dummy sound.
Which settings should I check?
Try this. Right-click your top level folder in PHP Explorer. Select the "Configure" menu item then "Add PHP Support".
Does you PHP Language Library include a link to your local PHP install? Sometimes I've found my project gets corrupted, and that PHP gets stripped from that include.
In this situation, simply reloading Eclipse helped.
For me, simply choosing 'Project > Clean' restores auto/code completion. (Eclipse 3.7.0 Indigo with PDT 3.0)
For me I needed to re-create my workspace (was using a workspace from an older version of PDT). Copying then importing the projects into the new workspace still worked.

Categories