Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Deploying Yii2 app to shared host steps

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 ?

like image 773
yoyoma Avatar asked Oct 31 '22 08:10


1 Answers

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.

like image 102
Mihai P. Avatar answered Dec 25 '22 09:12

Mihai P.