Reputation: 59
Yii2 advanced application with vendor folder its more than ~100 MB, so its very difficult to upload using FTP software.
Upvotes: 0
Views: 3225
Reputation: 14860
I recently had a similar problem and was without ssh access. I however noticed that the bulk of the size and files was caused by the .git
folders of my project and the vendors. My solution was to set my FTP client to ignore all files and folders starting with .git
.
On Filezilla, for example, this can be done by going to View->Filename Filters and editing the CVS and SVN
filter to ignore '.git*'.
Upvotes: 0
Reputation: 59
Steps for deploying yii2 advanced app on a shared hosting (note : You need to have ssh access to the server, if not: contact your hosting provider)
Generating a SSH Key Pair : open terminal and type the following
ssh-keygen -t dsa
OR
ssh-keygen -t rsa
The out put will be similar to
Generating public/private dsa key pair. Enter file in which to save the key (~/.ssh/id_dsa): Press [Enter] key Enter passphrase (empty for no passphrase): Press [Enter] key Enter same passphrase again: Press [Enter] key Your identification has been saved in ~/.ssh/id_dsa Your public key has been saved in ~/.ssh/id_dsa.pub The key fingerprint is:
OR
Generating public/private dsa key pair. Enter file in which to save the key (~/.ssh/id_dsa): Press [Enter] key Enter passphrase (empty for no passphrase): Press [Enter] key Enter same passphrase again: Press [Enter] key Your identification has been saved in ~/.ssh/id_dsa Your public key has been saved in ~/.ssh/id_dsa.pub The key fingerprint is:
For connecting your server, open terminal and enter following
ssh -l user remote-server
Replace user with your cpanel username and remote-server with your remote server host name. Enter your cpanel password, terminal will login your remote server using ssh.
Clone your application from git repository
git clone https://[email protected]/username/repository.git public_html
Go to public_html do the following
curl -sS https://getcomposer.org/installer | php
php composer.phar global require "fxp/composer-asset-plugin:1.0.0"
php init
Set environment as Production (recommended)
php composer.phar update
This will download all dependencies and setup your app, don't forget to configure database in main configuration file.
Upvotes: 3