在 Windows 上的远程服务器 (FTP) 上使用 Eclipse 开发 PHP
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6311717/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Developing PHP with Eclipse on a remote server (FTP) on Windows
提问by Tom Auger
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.
当谈到 Eclipse 时,我是一个真正的笨蛋,但我也很穷,这就是我选择它的原因。
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.
我已经安装了 Eclipse 3.5、Eclipse for PHP 和 RSE。我实际上已经到了可以创建新(本地)项目并将所有文件下载到本地(Windows)计算机的地步。我没有在本地机器上运行任何类型的 Web 服务器,我希望现在保持这种状态。
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.
我已将远程文件夹导入到本地项目中,在那里我可以查看所有 PHP 文件并对其进行编辑。但是当然,当我保存时,它只是保存本地副本。没有“放置”命令吗?我不能直接保存到服务器吗?或者立即同步那个文件?我当然不想在每次小的增量更改后都必须执行复杂的同步操作。
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)?
我不知道 RSE 到底是什么,也不知道它是如何工作的,而且文档充其量是隐蔽的,最糟糕的是不存在。有没有人给我一些提示?我的工作流程应该是什么(禁止任何本地服务器进行测试)?
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...
理想情况下,我希望能够直接从远程服务器上的位置打开整个“项目”,并完全避免处理“本地”副本。否则,我愿意“获取”整个远程站点一次,然后手动“放置”我在本地更改的单个文件,前提是这不是一个繁琐的过程。我要求太多了吗?Dreamweaver 以这种方式运行,但它对 PHP 的支持充其量是有限的,不能被视为成熟的 IDE...
回答by powtac
I use WinSCPand enable remote synchronization.
Everything that changes on the local system is automatically synchronized trough SCP/FTP onto the server.
我使用WinSCP并启用远程同步。
本地系统上的所有更改都会通过 SCP/FTP 自动同步到服务器上。
回答by baraboom
Looks like RSE might be overkill for your needs. Here's a similar question and popular answer to your problem of uploading from Eclipse:
看起来 RSE 可能对您的需求来说太过分了。对于从 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.
其次,您可以尝试像 SVN 这样的版本控制系统 - 设置它需要一点时间和工作,但可能比让 RSE 运行有用得多,然后您可以在本地开发,将更改提交到服务器然后更新服务器上的工作区。
Thirdly, there are other IDEs out there, like Netbeans, with built in support for working on remote files.
第三,还有其他 IDE,如 Netbeans,内置支持处理远程文件。
回答by jwwicks
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.
很抱歉拖延了一个旧主题,但远程系统资源管理器正是您所需要的。不需要 sFTP 或 Shell。在 RSE 透视图中设置连接,就像您通常使用 sFTP/SSH 客户端一样。
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.
现在导航到您的开发文件并双击或右键单击以打开文件。Eclipse 缓存本地副本,直到您保存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.
需要做一些shell工作。右键单击文件夹并启动终端。如果您的文件受源控制,例如 svn,您可以从终端签出或更新。
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.
我曾经拥有 Putty、FileZilla 和许多其他编辑器和实用程序。现在我永远不会离开 Eclipse。SQL、Shell、sFTP、PHP、CSS/HTML、C/C++、Droid,都在 Eclipse 中。
回答by Darvanen
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:
我认为@?ukasz 的笔记值得在此页面上给出答案 - 它可以为我节省大量时间,因此希望它对其他人也能如此:
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 Explorerallows you to develop PHP applications remotely.
这是 Eclipse 的绝佳教程:如何使用 PHP PDT、远程系统资源管理器、主题管理器和 Drupal 插件设置 Eclipse Eclipse + PDT + 远程系统资源管理器允许您远程开发 PHP 应用程序。
I will add that downloading and using the smaller Eclipse for PHP Developersand thus skipping step 2 on the blog works just fine.
我将添加下载和使用较小的Eclipse for PHP Developers,因此跳过博客上的第 2 步工作正常。
回答by wantTheBest
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.
我最近解决了同样的问题。我有一家网站托管公司,正在使用 SeaMonkey 并在“生产服务器”上开发代码,并学会了在“开发服务器”上进行开发,然后将调试后的工作内容上传到生产服务器。
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(它是一个很好的免费本地 Web 服务器,您可以轻松地安装在您的笔记本电脑上)并且我使用 NetBeans 进行开发。Netbeans 比微软的工具更好——没有鲍尔默参与交易。
xampp uses Apache as the (local) web server and provides Mysql and PHP server-side-scripting support.
xampp 使用 Apache 作为(本地)Web 服务器并提供 Mysql 和 PHP 服务器端脚本支持。
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.'
这两个的质量是HIGH。只是优秀的东西。您需要在笔记本电脑上运行本地 Web 服务器,在本地进行开发,然后使用 ftp 或 Netbeans 环境将文件上传到“生产 Web 服务器”。
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.
我尝试将本地 Web 服务器、调试器、mysql 数据库放在一起,尝试了许多不同的不相关部分,然后非常幸运,找到了 xampp,然后是 NetBeans。