Working on a PHP web project from GitHub in Eclipse - php

I am collaborating on a PHP project with a colleague using GitHub. I want to work on the code in Eclipse, and test the web pages within Eclipse. I have installed eGit and PDK in Eclipse. I think I have imported the project into Eclipse properly. Now I want to test some of the pages in Eclipse so I can get an idea of whats going on. Do I have to install a web server on my machine, or is there something built in to Eclipse for this?

You seem to have the hots for Eclipse, but this is web development, not desktop development. If you want to properly test a web application, it is better to use the most popular browsers to test it in, such as IE, Firefox and Chrome.
You will need a web server, yes, here are a few :
http://en.wikipedia.org/wiki/Comparison_of_WAMPs
Note that those are for windows, but some of them are multi platform, such as XAMPP.
Also, for a web development IDE, I recommend PHPStorm, you can try it for free here :
http://www.jetbrains.com/phpstorm/

The PDT plugin of Eclipse doesn't include a web server with it, you can check the main PDT page where it instructs you to install a web server to run and debug your code.
Newer versions of PHP do include a a built in web server to run code so, technically you don't need a web server, but you should probably set up Apache/Nginx to mimic what your code would run on in a production environment for less deployment headaches.
A quick and easy web server would be XAMPP. XAMPP is easy to set up and run and comes with Apache, MySQL, PHP and some other stuff useful for setting up your development enviornment.

Related

How Setup PHP development environment to use Eclipse IDE, IIS,Team Foundation Server(TFS)

I am new to PHP scripting language. Basically I am a .Net guy, worked on various web applications using MVC, Razor, ASP.NET, C#...etc. I thought this the best time to practice on PHP and planning to start work on projects using PHP.
I am trying to setup PHP development environment in my local machine.
Please guide me in the following questions.
What are the available software’s I need to install in my machine to start PHP development (SQL, IIS, PHP scrip, TFS)?
In order to create team project I want to use Team Foundation Server (TFS) within the eclipse IDE. Pease tell me someone, how to connect TFS from eclipse IDE (or) any alternate ways?
How to configure IIS to server PHP web pages? Do I need to install additional software other than eclipse?
I have done the following steps,
I downloaded Java from java.com.
I downloaded eclipse from eclipse.org then installed to my machine and pointed to default workspace(C:/users/xxxx/workspace).
Installed add-on phpeclipse to eclipse IDE. This add-on downloaded from phpeclipse.com
Open Eclipse IDE=> help=> Install New Software=> Add.
Name: [PHPEclipse]
Location: [http://phpeclipse.sourceforge.net/update/stable/1.2.x/]
Ok=> followed instruction to complete installation.
After completing the above steps, I just created a new PHP project then wrote echo statement in .php page but it prompting me below error when I run my test project

Developing PHP with Eclipse on a remote server (FTP) on Windows

I'm a real klutz when it comes to Eclipse, but I'm also poor, which is why it is the option I've chosen.
I've installed Eclipse 3.5, Eclipse for PHP, and RSE. I've actually gotten to a point where I can create a new (local) project and download all files to my local (Windows) computer. I'm not running any kind of web server on my local box, and am hoping to keep it that way for now.
I've imported my remote folder into my local project, where I can see all my PHP files and edit them. But of course, when I save, it just saves the local copy. Is there no "put" command? Can I not save straight to the server? Or perform an immediate sync of that one file? I certainly wouldn't want to have to perform a complex sync operation after every little incremental change.
I have no idea what RSE really is, nor how it works, and the documentation is, well, cloaked at best, non-existent at worst. Does anyone have some tips for me? What should my workflow be (barring any local server to test)?
Ideally, I would love to be able to open up the entire "project" directly from its location on the remote server and avoid dealing with a "local" copy altogether. Failing that, I would be willing to "get" the entire remote site once, and then manually "put" individual files that I change locally back, provided it's not a cumbersome process. Am I asking too much? Dreamweaver operates this way, but it's support for PHP is limited at best and can't be considered a full-fledged IDE...
I use WinSCP and enable remote synchronization.
Everything that changes on the local system is automatically synchronized trough SCP/FTP onto the server.
Looks like RSE might be overkill for your needs. Here's a similar question and popular answer to your problem of uploading from Eclipse:
How do I add FTP support to Eclipse?
Secondly, you could try out a version control system like SVN - it would take a little bit of time and work to set it up but probably be far more useful than getting RSE going and then you could develop locally, commit your changes to the server and then update the workspace on the server.
Thirdly, there are other IDEs out there, like Netbeans, with built in support for working on remote files.
Sorry to drag up an old topic but Remote System Explorer is exactly what you need. No need for sFTP or a Shell. Setup the connection in the RSE perspective just like you normally would using your sFTP/SSH client.
Open the folder for the first time and you get the login dialog. Enter your credentials. Store them as needed.
Now navigate to your development files and double click or right click to open the file. Eclipse caches a local copy till you save, Ctrl-S.
Need to do some shell work. Right click on a folder and Launch a Terminal. If your files are source controlled, such as svn, you can checkout or update from the terminal.
I use to have Putty, FileZilla and a host of other editors and utilities. Now I never leave Eclipse. SQL, Shell, sFTP, PHP, CSS/HTML, C/C++, Droid, all within Eclipse.
I tackled the same problem recently. I got a web site hosting company and was using SeaMonkey and developing the code on the 'production server' and learned to do development on a 'development server' and then upload the debugged, working stuff to the production server.
So I use Xampp (it's a good, and FREE, local web server you can easily install on your laptop) and I use NetBeans to develop. Netbeans is better than Microsoft tools -- no ballmer involved in the deal.
xampp uses Apache as the (local) web server and provides Mysql and PHP server-side-scripting support.
The quality of these two is HIGH. Just excellent stuff. You will want to get a local web server running on your laptop, do your development locally, then upload using ftp or the Netbeans environment, the files to your 'production web server.'
I messed around with a lot of different unrelated pieces trying to put a local web server, debugger, mysql database together and then got really lucky and found xampp and then NetBeans.
I think #Łukasz's note deserves to be an answer on this page - it would have saved me a great deal of time, so hopefully it will do the same for others:
Here is great tutorial for Eclipse: How to setup Eclipse with PHP PDT, Remote System Explorer, Theme Manager, and Drupal Plugins Eclipse + PDT + Remote System Explorer allows you to develop PHP applications remotely.
I will add that downloading and using the smaller Eclipse for PHP Developers and thus skipping step 2 on the blog works just fine.

Working on a remote PHP project (Ubuntu Server) via Eclipse, Netbeans or any other IDE

I am wokring on a PHP project, which is located on an Ubuntu server to which I have SSH access.
Sometimes I code in Ubuntu and sometimes in Windows (mostly Ubuntu).
Do you have any idea how to connect to the project on the server and edit the files. I searched the net, got some ideas like using SSHFS, but I want something which works both on Linux and Windows.
I also found Eclipse Remote System Explorer, but I think it is not that stable and might cause problems (correct me if I am wrong).
Basically I (like) code in Eclipse, but I can move to Netbeans or any other good (but Free) IDEs, if I have to.
Thanks.
Aptana Studio 3 has everything you need
ssh w/ built in terminal
sftp (connect FTP through SSH)
Eclipse Based
GIT/SVN support
PHP Support
etc...
Related to your comment:
How Connect to remote host from Aptana Studio 3
http://vimeo.com/aptana
At my company each developer has a windows PC to work from with a linux dev VM that mirrors production's setup. The linux servers have a samba share setup to the /var/www directory. There are two common workflows we follow.
The developer checks out the code repo to their local PC. They use Netbeans (previously Eclipse) to edit the files and an IDE feature copies the edited file to the webserver via samba.
Pro: fast
Con: webserver can get out of sync, only one way syncing: windows -> VM
The developer checks out the code repo to the samba folder. They open the code from the IDE and edit from there.
Pro: two way syncing, can edit from server if need be, can use any editor/IDE
Con: slow
We ran for a while under setup 2, but quickly found that it was far too slow for us so most use setup 1. The only exceptions are remote teams that find it easier to connect directly to the VMs.
I use Emacs with Tramp plug-in.
I use eclipse with Aptana. There you can easily use the build in FTP support to connect to the server.
Another solution would be mouting the server directory to your PC. On Windows systems you can use something like WebDrive.

Best methodology for PHP+APACHE+MYSQL Development

I want to start learning PHP. I have had a look at the various options available to install the PHP+MySQL+Apache combination. But it all seems too cumbersome and a lot of editing to the CONF files always leads to one problem or the other. So I had a couple of questions to ask:
1) How will something like WAMP help me? If I install WAMP, will that be enough?
2) Isn't there some Eclipse like IDE ( coming from a Java Background ), that allows WAMP to be integrated with it? ( Or is typing on Notepad the only option available )?
Please help me out by explaining things a little elaborately. Thank you so much for your time and patience.
i personally use xampp and netbeans for my local web development. you can actually set up the netbeans project wherever you want, so you can just place all your files in the htdocs folder of xampp (at C:\xampp) and edit the files in the folder directly. This will allow you to immediately see any changes you have made by reloading the web page.
xampp allows you to run apache (with mod_php installed and configured) and mysql on your local machine and even includes a handy panel to let you start and stop them at any time.
netbeans has a lot of tools for easy development and support for frameworks like Zend. You can also use it for many other languages should you wish to expand.
I prefer WAMP because it doesn't try to do anything fancy with configurations... when you install it, you get PHP, Apache, MySQL, and phpMyAdmin with each of their default configurations and extensions loaded. It's the same as installing them separately, only they're all in one convenient directory, and you get the handy tray icon to restart services and enable/disable extensions.
As for an IDE, I use Eclipse PHP Development Tools (PDT), but I've heard good things about Netbeans too. Eclipse can do everything Scott described Netbeans being able to do as well. You also might want to look into Aptana which was branched from Eclipse PDT but is now maintained by a different team.
you can go ahead and install xampp from apachefriends, it comes with an apache web server, mysql database, phpmyadmin and a control panel for both servers, and installs fairly quick and with the default settings you will be pretty much set. Not sure what integration you'd want between the editor and the webserver though. if you mean code folding, autocomplete and all that stuff, eclipse has a php-friendly version, and so does netbeans (these 2 are the most popular choices as far as i've seen)

Help setting up php for Eclipse

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.
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.
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
Than, Click On Add
Finally, Add this link: http://download.eclipse.org/releases/indigo for all the list of Add-Ons
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 ;)
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.
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"
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.
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"

Categories