简体   繁体   English

如何使用composer和FTP部署Laravel 5

[英]How to deploy a Laravel 5 using composer and FTP

I built a project using Laravel 5 on my dev machine and now I'd like to deploy it. 我在我的开发机器上使用Laravel 5构建了一个项目,现在我想部署它。 One solution that came to my mind is to upload everything using FTP but I guess there is a better way. 我想到的一个解决方案是使用FTP上传所有内容,但我想有更好的方法。

I uploaded the composer.json but I receive tons of errors. 我上传了composer.json,但收到了大量的错误。 I have ssh/root access but using GIT is not an option. 我有ssh / root访问权限,但使用GIT不是一个选项。

Make sure you can use composer binary on your server and you are set 确保您可以在服务器上使用composer二进制文件并进行设置

  • upload every file except vendor folder (you may use some FTPS manager that reads git-ignore file and does not upload ignored files) 上传除供应商文件夹以外的每个文件(您可以使用一些读取git-ignore文件但不上传被忽略文件的FTPS管理器
  • set permissions to ./storage folder (browse thru this severfault thread ) 设置./storage文件夹的权限(通过此severrefault线程浏览)
  • make sure your web server root is ./public 确保您的Web服务器根目录是./public
  • create env file (that is not going to be changed ever, until you want) and do not overwrite it with "local" env file . 创建env文件(除非你想要,否则不会改变)并且不要用“本地” env文件覆盖它。
  • $ composer install (installs everything from composer.lock) $ composer install (安装composer.lock中的所有内容)
  • $ composer update (updates from repositories again, do test on local before updating on production) $ composer update (再次从存储库更新,在生产更新之前在本地测试

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

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