Installation script for setting DB

I want to create script in yii2 which will ask the user for db host,name,password and after successful completion redirect to the main page of the application

I want to do this using advanced template

What exactly are the problems with you?

In other words, what do you think is difficult for you to accomplish?