Developing PHP with Eclipse on a remote server (FT

2019-01-22 08:59发布

问题:

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...

回答1:

I use WinSCP and enable remote synchronization.
Everything that changes on the local system is automatically synchronized trough SCP/FTP onto the server.



回答2:

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.



回答3:

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.



回答4:

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.



回答5:

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.