0

I want create an installation controller for my web app and for config db need run migration commands from controller.

For example when user visit

localhost/backend/webapp/index.php?install/step1

by action step1 run migrate up and down command and do installation.

Aminkt
  • 612
  • 9
  • 25
  • 2
    Possible duplicate of [How can I call a console command in web application in Yii 2.0](http://stackoverflow.com/questions/25355483/how-can-i-call-a-console-command-in-web-application-in-yii-2-0) – soju Mar 09 '16 at 20:31
  • Perhaps combining http://stackoverflow.com/a/35864018/1592247 and `exec` function of `php` could helps you. hum? – meysam Mar 10 '16 at 06:52

1 Answers1

0

Thanks from @soju and @meysam you can use both solutions.

  1. Use exec:

Perhaps combining stackoverflow.com/a/35864018/1592247 and exec function of php could helps (@meysam)

  1. Use extensions:

How can I call a console command in web application in Yii 2.0 (@soju)

Both way may help you. be aware using exec may cause some security issues and disable in some servers.

Aminkt
  • 612
  • 9
  • 25