dqjo4340
2015-09-14 15:23
浏览 74
已采纳

使用Git,Laravel,PHPStorm和VPS进行复杂的设置

What I have so far:

  • Two VirtualBox LAMP machines (separate locations) where I connect my two Windows development machines via SFTP, to write code using PHPStorm.
  • One VPS machine where I deploy my code written for a project in Laravel.

What I am trying to achieve:

Fast and easy code deployment, as in: write the code in Windows via PHPStorm, test it on the LAMP machine, deploy to VPS if necessary.

The problem is that I need to use some php artisan commands on LAMP machines to get some code generated. This means that I always have to synchronize PHPStorm with LAMP files tree in order to see the changes. Then, I need to also sync the other dev (LAMP) machine and the other PHPStorm running on Windows machine number 2. I know that this can be done via Git. So everytime I use the command line to generate code, I need to sync 4 machines (excluding the deployment server).

Later, if I add another pair of Windows/LAMP dev machines, the complexity grows.

Back in the days of Dreamweaver, I could write code directly on the deployment server. Not the greatest idea, but it was way much simpler and faster, and that's what I need now.

Any ideas on how can I simplify this?

Switching to WAMP so I can have files in sync with PHPStorm (because all is locally) is not OK because... Windows and PHP libraries issues :)

Also, switching to Dreamweaver is not OK either.

What other options do I have?

Thanks!

LE: on the side, I am also thinking if a NAS can be helpful for this type of problem.

LLE: is Linux Desktop + PHPStorm the only straight solution?

图片转代码服务由CSDN问答提供 功能建议

到目前为止我所拥有的:

  • 两个VirtualBox LAMP机器(单独的位置),我通过SFTP连接我的两台Windows开发机器,使用PHPStorm编写代码。
  • 我在Laravel中部署为项目编写的代码的一台VPS计算机。

    我想要实现的目标:

    快速简便的代码部署,例如:通过PHPStorm在Windows中编写代码,在LAMP机器上测试代码,必要时部署到VPS。

    问题是我需要在LAMP机器上使用一些 php artisan 命令来生成一些代码。 这意味着我总是必须将PHPStorm与LAMP文件树同步才能看到更改。 然后,我还需要同步其他开发(LAMP)机器和运行在Windows机器2上的另一台PHPStorm。我知道这可以通过Git完成。 每当我使用命令行生成代码时,我需要 同步4台机器(不包括部署服务器)。

    稍后,如果我添加另一对Windows / LAMP开发机器,复杂性会增加。

    回到Dreamweaver的时代,我可以直接在部署服务器上编写代码。 这不是最好的想法,但它更简单,更快,而且这就是我现在所需要的。

    关于如何简化这一点的任何想法? < p>切换到WAMP所以我可以让文件与PHPStorm同步(因为所有文件都在本地)不正常,因为... Windows和PHP库问题:)

    此外,切换到Dreamweaver 也不行。

    我还有哪些其他选择?

    谢谢!

    LE:on 另外,我也在考虑NAS是否可以帮助解决这类问题。

    LLE:Linux Desktop + PHPStorm是唯一直接的解决方案吗?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dougai2427 2015-09-17 20:48
    已采纳

    How I solved the problem:

    I have an extra Mac, on which I installed everything for my PHP ecosystem, including the IDE, so everything is local. That's the dev machine. Then I manually copy the code to the VPS when needed. Another solution was to install Ubuntu Desktop (or similar) on dual boot with Windows and use it as a local dev environment.

    Much faster development / deployment :)

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • doudou2121 2015-09-14 15:29

    No matter the protocols

    You can put your code outside of the guest machine and configure the guest machine to mount the code (mount a folder from the host inside the guest).

    Apache will run slower because it will use the mounted remote-folder but PHPStorm will run at its maximum speed.

    Taking protocols into consideration

    Try using SSHFS on windows.

    I use SSHFS for remote development from my Linux host machine to headless vagrant boxes (and/or to remote development servers / staging servers).

    It's much faster than SAMBA (the windows SMB protocol) and oddly faster than NFS even though SSH uses encryption.

    Coleages using Windows+SMB often leave their computers for 30 min while PHPStorm is indexing and git branch changes on the dev machine go unnoticed for minutes at a time.

    Indexing over SSHFS usually takes less than 5 min on a Symfony2 project. Branch changes are detected in less than 15s.


    Using Linux (shameless plug)

    Linux is nice, and it's free, and it works out of the box (Ubuntu) -- including pesky USB-Modems which would normally require an install on windows.

    You already know how to handle a Linux CLI the learning curve is already halfway crossed.

    Auto-updates don't rule your life, they're not the king of you!

    All the applications you need are part of the software repositories you don't need to look for anything, download 40+ executables and attempt to install them just to be welcomed by an error "invalid architecture", "windows version not supported", ".NET framework version too old", "DirectX version too new (wtf?)", "your cousin is a software pirate".

    Dependency management is a concept Linux never fully solved -- but at least the bloody tried and in 90% of consumer use-cases it fits the bill. Windows is still eating glue at the back of the class.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题