How To Upload Your Yii Project To Run On A Live Server

Hi all!

I’ve just bought a live server from godaddy.com and want to know is there a standard way to let my project run on my live server. What should I do with my database, what should I config file main.php to let the thing goes well. I’ve heard something like svn. It’s needed for team development. I’m working alone, so maybe I don’t need it. Is there away to edit my project on my desktop so everything will be changed accordingly on my live server. I’m asking that because we have to modify many things at many times in the future.

Thank you for your reading.

Hope to see some nice suggestions or just a few things to get me started.

Cheers!

You should use a distributed version control system -> git (or mercurial) even if you don’t work in a team.

You work "offline" on your workstation with all the advantage of a clean project development:

commit/compare changes, revert, working with branches, releases …

Then you “push” your release to the linux server. If somethings doesn’t work as expected at the server you can revert back to a previous state.

At the server you can create a ‘bare repository’ and use a ‘hook’ to checkout the code into your htdocs directory after ‘push’ from your workstation. You can add a line to the ‘post-receive’ hook to clear the assets dir and more.

You will need some time learn working with git, but it’s worth every minute.

Maybe you don’t need different config/main.php at the server, if you set ‘localhost’ as your db-connection.

Otherwise search for ‘Yii multiple environment’.

There exists some articles or extensions: yii-environment

Thank you for very useful information!