Help setting up php for Eclipse
Asked Answered
S

6

14

I'm trying to set up Eclipse for php web development. What I would like to do is preview a php web page from within Eclipse, but I cannot figure out how to do this. Is there an integrated web server of some sort that allows this, or do I have to set up IIS/Apache to do it? If so, do I have to have my php files in the web servers path, or does Eclipse auto deploy the files to the local web server? Any information or links would be very much appreciated.

Supranatural answered 26/10, 2008 at 18:58 Comment(1)
this question is a top Google hit for "eclipse php setup", but it's a bit outdated. Does anybody know a good setup guide for Eclipse Luna (2014 edition)?Hammock
S
8

There is a plugin for Eclipse called PDT which makes PHP development a breeze.

For an overview on how to install it, you can refer to the Eclipse website:

http://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_2.0

To actually view the PHP scripts running, I would imagine that you'd have to have some sort of server already installed and running. You could probably set the workspace location to be in the server path, and then view the files through localhost. But maybe the PDT package takes care of some of that for you.

Sleave answered 26/10, 2008 at 20:44 Comment(0)
C
7

I will make it Very Easy ;)

(1) Go to Eclipse home: http://www.eclipse.org/downloads/ and download Eclipse Classic (Current May/2013 version is 4.2.2)

(2) One you have eclipse fired-up in you machine Do followings : Help > Install Software

Help > Install Software

Than, Click On Add Click On Add

Finally, Add this link: http://download.eclipse.org/releases/indigo for all the list of Add-Ons Add

and pick PHP under Web Addon (Should be last in the list) and Install it.

Restart you eclipse + thumbs-up to my Ans. and Start Coding ;)

Cantharides answered 11/5, 2013 at 8:18 Comment(0)
M
4

I setup apache/php/MySQL on my windows PC, so that testing environment is not totally unlike my servers (excepting the OS, but 90% of the time that's okay). I create alias's in the Apache configuration to the Eclipse workspace, and just hop between the browser and eclipse. The URL for testing is something like:

http://localhost/project_name/file.php

While this isn't ideal, it is a fairly consistent/smooth process that doesn't require a great deal of configuration within Eclipse. I keep thinking there should be a better way, but I honestly don't think I'm burning enough time to justify the research. Once the setup is done, I don't really loose more time after that, and I can control which version of PHP I'm running on my system.

I don't tend to like integrated browsers for testing of web applications anyway. Every time I've dealt with one, it was completely different from a "real" browser that I had to completely retest anyway. At least this way, I have my Firefox testing done when I'm through the first pass of the logic.

Manus answered 26/10, 2008 at 20:47 Comment(0)
D
2

try easyeclipse, it the easiest Eclipse setup i've found

"EasyEclipse for LAMP: For PHP, Python, Perl, and Ruby development with a web server and a database"

Drugi answered 27/10, 2008 at 3:34 Comment(0)
T
2

I would also recommend downloading and installing WAMP server which is a really easy all in one Windows equivalent (windows, Apache, MySQL, PHP) of what you are likely to have with a commercial web host. See http://www.wampserver.com for details and download.

As well as pdt which had already been mentioned other alternatives are phpeclipse and aptana studio which is based on eclipse.

Treatment answered 21/11, 2011 at 12:32 Comment(0)
C
0

Visit this website https://eclipse.org/pdt/. Go to where it says 'Update existing Eclipse'.

The procedure is this "In Eclipse, click Help -> Install New Software and work with *: http://download.eclipse.org/tools/pdt/updates/3.6"

Christoffer answered 27/11, 2015 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.