简体   繁体   English

PhpStorm-在本地调试,在远程服务器上部署

[英]PhpStorm - debug on local, deploy on remote server

I'm working on a website using PhpStorm. 我正在使用PhpStorm建立网站。 For a long time I developed it locally, but then I got hosting and a remote ftp server. 很长时间以来,我都是在本地开发它的,但是后来我得到了托管和一个远程ftp服务器。

I created a new project in PhpStorm with the settings for remote host, and I found that deploying code takes long time (over a minute) before I can see the result, which is quite uncomfortable when debugging. 我在PhpStorm中使用远程主机的设置创建了一个新项目,我发现部署代码需要很长时间(超过一分钟)才能看到结果,这在调试时非常不舒服。

Is there any possibility to work with code on a local server, and, when I think that the project is ready for deploy, just send it to the server. 是否有可能在本地服务器上使用代码,并且当我认为该项目已准备好进行部署时,只需将其发送到服务器即可。

I understand, that I can just work in two different projects and just deploy the "ready" version to server via FTP, but maybe there is some more comfortable way? 我了解,我可以在两个不同的项目中工作,也可以通过FTP将“就绪”版本部署到服务器,但是也许有更舒适的方法吗?

There is several answers to this question, and most of them opinion based but i will try and keep it objective. 这个问题有几个答案,而且大多数都是基于观点的,但我会尽量保持客观。

Case 1 情况1

A big corporation gives every developer a sandbox, to test their code from, the corp requires every developer to keep their code on the sandbox. 一家大公司为每个开发人员提供一个沙箱,以测试其代码,该公司要求每个开发人员将其代码保存在沙箱中。 Using mounted drives could be extremely slow. 使用安装的驱动器可能会非常慢。 Especially when PhpStorm is indexing. 特别是在PhpStorm正在建立索引时。

Case 2 情况二

An easy way to keep an auto backup of your code it to use the build in (s)ftp(s) upload/deploy. 一种简单的方法,可以自动保存代码,以使用内置的ftp上传/部署。

Solution

In both cases you could use the auto deploy feature that saves every changes to the server, that way the deploy doesn't take over a minute, but is usually already there before you know it. 在这两种情况下,您都可以使用自动部署功能将所有更改保存到服务器,这样一来部署不会花费一分钟,但是通常在您知道之前就已经存在。

I cannot recommend to use the deployment for Production as it will not pass through your version control, SAT, security setups etc. In that case I would suggest something like rocketeer etc. 我不建议将部署用于生产环境,因为它不会通过您的版本控制,SAT,安全设置等。在这种情况下,我建议您使用Rocketer等。

EDIT : 编辑

As for 2 projects, well you can define 2 different deployment servers, and use the default one for your testing, with auto upload or something, and then the other one can be selected from the deployment menu. 对于2个项目,您可以定义2个不同的部署服务器,并使用默认的一台进行自动上传或其他测试,然后从部署菜单中选择另一台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Maven部署到远程服务器 - Maven deploy to remote server 如何使用capifony [Net :: SSH :: AuthenticationFailed]将Symfony2.1本地网站部署到远程服务器? - How to deploy a Symfony2.1 local website to a remote server using capifony [Net::SSH::AuthenticationFailed]? 如何将Webapp从本地计算机部署到远程服务器(播放框架1.2.7 + Nginx + Jetty + Debian) - How to deploy webapp from local machine to a remote server ( play framework 1.2.7 + nginx + jetty + debian ) 从Git部署的正确方法。 (本地->远程Git->实时服务器) - Proper way to deploy from Git. (Local -> Remote Git -> Live server) ReactJS:如何在本地服务器上部署 - ReactJS: How to deploy on local server 当glassfish远程部署有效时,Netbeans Local部署失败 - Netbeans Local deploy fails while glassfish remote deploy works 如何将Spring MVC部署到远程Tomcat服务器 - How to deploy Spring MVC to remote Tomcat server 从NetBeans在远程tomcat服务器上部署Webapp - Deploy webapp on remote tomcat server from netbeans 将ASP.NET应用程序部署到远程服务器 - Deploy ASP.NET app to remote server 通过Jenkins在远程服务器上部署jar - Deploy jar on a remote server via Jenkins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM