Initial Yii Installation Env Path + running INIT (important!)

  1. After instaling WAMP, the location of the PHP binary needs to be added to the path.
  2. Then the Yii2 installation needs to be initialized.

c:\wamp\www\advanced>yii init
Could not open input file: c:\wamp\www\advanced\yii

c:\wamp\www\advanced>php yii init
Could not open input file: yii

c:\wamp\www\advanced>php init
Yii Application Initialization Tool v1.0

Which environment do you want the application to be initialized in?

[0] Development
[1] Production

Your choice [0-1, or “q” to quit] 0

Initialize the application under ‘Development’ environment? [yes|no] yes


  1. Then the DB needs to be initialized (matching the config)


Without running this step, Yii cant be accessed  (index.php will be missing).


Then the migration script needs to be run.

c:\wamp\www\advanced>php yii migrate
Yii Migration Tool (based on Yii v2.0.10)

Creating migration history table “migration”…Done.
Total 1 new migration to be applied:

Apply the above migration? (yes|no) [no]:yes
*** applying m130524_201442_init
> create table {{%user}} … done (time: 0.032s)
*** applied m130524_201442_init (time: 0.169s)
1 migration was applied.

Migrated up successfully.



Leave a Reply

Your email address will not be published. Required fields are marked *