Search code examples
phpyiiinitializr

Where is the Vendor module in YII Initializr?


I have installed YII Initializr module and YII framework is in my PHP Include path. But as soon as I run mysite/frontend/www/index.php, I get this error:

Warning: require(./../../common/lib/vendor/autoload.php): failed to open stream: No such file or directory in D:\xampp\htdocs\yiiinit\frontend\www\index.php on line 12    
Fatal error: require(): Failed opening required './../../common/lib/vendor/autoload.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\yiiinit\frontend\www\index.php on line 12

Please help.


Solution

  • Here are the steps to generate vendor autoload.php file.

    Step 1. Create account on https://github.com and go into setting => Personal access tokens i.e. https://github.com/settings/tokens

    Step 2. Generate github access token.

    Step 3. Now open command prompt (cmd) and go into the folder where yii installed and run command => composer update (Note:- there should be a composer.json file).

    Step 4. cmd require Token form your side now copy token generated in step 2 and paste it in cmd.

    Step 5. Yii2 Frameworke installed successfully now browse web/index.php