Deploying Yii2 app to shared host steps

孤者浪人 提交于 2019-12-01 17:41:19

问题


I find it bizarre that there is so little, (if any) details on considerations for deploying a Yii2 app to a shared host server.

Does anyone have some steps, tips, considerations for this ?

Is there a process you follow that keeps issues/errors down to a minimum ?

How does the DB get migrated (with data)? I'm assuming I could do export/import of the DB, copy the Yii app folder directly, but that seems too simplistic ?


回答1:


First read this page http://www.yiiframework.com/doc-2.0/guide-tutorial-shared-hosting.html

Regarding the files yes, just copy them. If your host allows you ssh access (but not git) you can have them copied very fast with rsync (so you can use composer etc on your computer and deploy through ssh). I have done a similar script that does the same thing with FTP at 1 point but it was much slower. Since I have stopped making websites for shared hosting.

Regarding the migrations you can make them run from the browser too for example How to handle yii2 migrations on hosts without console access? Make sure you read the answer and the comments too and follow that link.



来源:https://stackoverflow.com/questions/29110415/deploying-yii2-app-to-shared-host-steps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!