简体   繁体   中英

How can i upload my Laravel project on remote server and start Live deployment?

我正在使用Laravel 4开发一个Web应用程序,该应用程序很大,并且仍在开发中,这里的问题是我正在Mac上进行开发,但是另一个Web设计人员希望编辑视图文件并开始异步工作。 ,我们有一个托管服务器,我可以通过SSH访问它,已经在其中安装了git,我真正想要做的是,通过Git将本地项目克隆到远程服务器中,然后开始通过PhpStorm 7将更改提交到服务器上。你们能给我一些步骤,我可以按照这些步骤将本地项目克隆到远程服务器,以及如何在服务器上的文件中保存更改!

A great way to do this is http://github.com ; start an account and use the "private" feature if it isn't a public project. They explain it all very well, but here's a link to the "Create a Repo" page: https://help.github.com/articles/create-a-repo/ .

If you aren't interested in using git, it's still pretty easy, but not quite as much:

- cd /path/to/your/<future-repo>
- git init 
- git add .
- git commit
- cd .. && git clone --bare <future-repo> repo.git # repo.git is whatever you choose
- scp -r repo.git user@server:/path/to/repo.git
- log onto server;
- cd /path/to/repo.git
- chmod 775 find . -type d (so group will have permissions, if needed)
- git repo-config core.sharedRepository true

Then you each can clone it:

- git clone user@server:/path/to/repo.git ./repo

OR

- it clone ssh://USERNAME@SERVER.com:~/repo.git ./repo

What I do is all built into my editor. I maintain my app with version control, but it is much easier to just have a synced local copy and then open the project locally so it can be indexed with your editor like Atom, PhpStorm, or Sublime Text. Then in most of these editors you can easily just use a remote sftp style syncing tool. If you are on a shared host you might have to use a syslink to make sure public is forwarded to -> public_html, but that is about all you need to do.

I like to work locally and test on a VM with port forwarding that is identical to my server and then push to the server itself within my editor. This method works really well. You just need to make sure you ignore your .env file and possibly any other files that reference the site URL if you have for example style tags in your HTML markup, or blade app.blade.php file. And of course if you use git the .git file and other non-production based files, but since it is outside of the web route it isn't as dangerous, but better safe then sorry.

  1. Atom - https://atom.io/packages/remote-sync
  2. PhpStorm - built in I believe
  3. Sublime Text - http://wbond.net/sublime_packages/sftp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM