Eclipse PDT installation - php

I have a project that's intended to use some PHP as well as Java and Javascript, so I installed the PDT PHP plug-in for Eclipse, using the Install New Software menu option. Now Eclipse agrees PDT is installed, but no PHP features like creating or editing PHP files are appearing anywhere. Is there something else I need to do to activate PDT? (I did restart Eclipse like it said I needed to.)

Right click on your project, Configure (it's at the bottom of the list)->Add PHP Support...
After it's done, you should see a little P symbol in the project's icon.

Just create new project using the wizard, and choose PHP one. After Eclipse will know that your project is actually based on PHP, it will show you all the features.
In case if you have existing project, just open the PHP perspective.

I've once had a similar problem. Eclipse was running with the JRE 1.4, and it seems the JRE 1.5 or later is required to run the PDT. I switched to Java 1.6 and that solved the problem.

I run into this sometimes with eclipse plugins.
Have you tried uninstalling it, removing the jar and files it from eclipse/plugins and eclipse/features, then installing it again?
If you don't feel like doing that. Try installing it in a clean eclipse instance and if it works then it's just a config issue with eclipse.
You might have not installed all of the tools too.

The solution I eventually came up with was to just install Aptana Studio, a PHP IDE based on Eclipse, whose standalone version can coexist happily with the regular Eclipse on the same machine.

In order to have PHP support in eclipse project, you need to add PHPNature to the project. It's a kind of configuration paramter of eclipse project. When you craete a new PHP project using a wizard, check the .project file in a new project directory. There is a PHPNature line. Copy this line into .project of your java project.
Another solution is to separate java and php code in a different projects, each one craeted by right wizard.

Related

What is the right way to install codesniffer to Aptana Studio standalone version?

I followed this guide for eclipse integration on drupal:
https://drupal.org/node/1420004
I tried to install PTI plugin to Aptana
(Aptana Studio 3, build: 3.4.1.201306062137, with Eclipse Platform Version: 3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q)
, but got a lot requirement missing errors.
Then I enable Eclipse Indigo Update Site (http://download.eclipse.org/releases/indigo) in my Aptana, and installed it successfully this time.
Then I config it like this:
But it just don't work!
I have installed php codesniffer and pear library, it works perfectly in command-line, and git pre-commit hook, but I can't get it work in Aptana.
Even I right click on a file, the PHP Codesniffer is grey and unclickable.
I wonder what is the right way to install codesniffer to Aptana Studio ?
You will need to set up the "PHP Executer". Use the link on the side of that select-box and configure one, poiting to the php binary you have. It probably is /usr/bin/php5. If the .ini file is required, it'll probably reside in /etc/php5/cli/ or /etc/php5/apache2/.
If those are not correct, you can execute and retrieve the location of that information.
I needed to set this up in order to have my codesniffer working. I couldn't find how to make it work without clicking in the button in the editor's toolbar, but It worked.

Why can't I create PHP project using Eclipse Juno?

I have Eclipse Juno installed in Fedora 17 from the standard Fedora repositories.
I've added PDT from the Eclipse repository using the help->install new software interface.
However, when I go to create a new project I don't get the option to create a PHP project, only plain 'General' projects.
Why doesn't Eclipse let me create a PHP project and how can I fix this?
I closed Eclipse and deleted ~/.eclipse/*, restarted Eclipse and the PHP plugins (and others) seem to have woken up.
Still don't know what was causing it, but I'm in a place I can get work done now at least!

Is it possible to "marry" Eclipse PHP with Java EE?

I've already got Eclipse for PHP-developers installed. Must I install a new version for Java EE, or can I "marry" it into the PHP version, for instance trough updates or plug-ins? The reason I ask is 1) I want to save space ('cause I'm greedy), 2) I want to not have to switch programs all the time ('cause I'm lazy). :)
Is it possible?
How do you do it?
get yourself eclipse classic
go to Help > Install new software
install PDT things
install Java EE things
use it while switching the perspectives
P.S. you might want to look into Aptana's eclipse plugin as alternative to PDT, while you're at it . Some people prefer it (ST2 user .. no real stake in this)
It should be possible to install both the PDT Eclipse and the Jave EE eclipse into the same folder i.e. merge the plugin folders.
Then you can use both features in the same Eclipse version.
You can add all the Java EE plugins and add the Java EE functionality to your copy. I actually did this the other way around. I started with Java EE and added the PDT php tools to my eclipse and it works fine.

What to do to dubug/execute an existing PHP project

I am beginner to PHP. I want to debug/execute an existing PHP project. I have already installed Eclipse as IDE and what else should be installed in my system (OS is Windows xp).
And what and all settings should do in that...??
I request you to invest few seconds for this "Kid of PHP".......
I would recommend installing xampp, it allows you to run a website on your local machine.
php and a web server would come in handy ;-)
http://windows.php.net/download/
http://www.apache.org/dyn/closer.cgi
Firephp is a Firefox extension. It works as a module of Firebug. After you install it and add the php library to your code your messages will appear inside the browser. A real quick and clear way to debug in php.
Since you said you are a beginner, it is better NOT to go after advanced debuggers like xDebug at the moment.
print_r(); die;
is the best debugging tool for you now.
Also if you want to nicely format the output of print_r() when arrays or objects are shown, do this:-
echo '<pre>', print_r($array), '</pre>';
And Eclipse! If you are a beginner (or pro), definitely go for NetBeans. NetBeans comes with built-in support for xDebug and zend debugger and a lot other cool stuff you can use when you learn more. If you are going with Eclipse, you will need to install Eclipse extensions like PDT for making Eclipse support PHP.
Of course you will need a web server with PHP support. If you already don't have that, install xampp as somebody mentioned earlier. That's the easy way to get the web server running quickly.
NetBeans is just great, everything works out of the box. Very little to configure. (I'm a former Eclipse user)

eclipse helios for PHP - code formatter not available

I'm looking at my Eclipse helios (3.6) preferences page, and I can see I can set code formatting settings for the Java code, but not for PHP.
How can I set the spacing for function arguments in Eclipse for PHP. It seems the changes I make for Java don't apply to the PHP code.
I know that when I got Eclipse, I downloaded the version that was specifically for PHP: http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr1
It's likely that the version you downloaded is the base version and does not have the additional PHP features included.
EDIT:
Check out http://en.sourceforge.jp/projects/pdt-tools/releases/?package_id=8764 for an Eclipse dropin you can use(the site is in Japanese, but I was able to find the download link easily). This may be what you're looking for. To install, just place it in the dropins folder of your Eclipse install and restart Eclipse.
It took me a while to figure out that was my problem a couple years ago.
Eclipse maintains a section just for PHP Eclipse that includes everything you need for coding PHP in Eclipse.

Categories