Where is the Vendor module in YII Initializr?

10.5k Views Asked by At

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.

5

There are 5 best solutions below

2
On BEST ANSWER

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

0
On

Missing /vendor/autoload.php file is generated automatically by composer after package installation.

You must first install composer (sell documentation). Then run php composer.phar install or if installed globally composer install in the directory where composer.json file is located

0
On

if you are using composer, install mbstring for your PHP version and run composer install again

0
On

With experience it seems that composer does not download the vendor folder with a slow internet connection. If composer returns any error when installing the basic application try downloading it manually and then work from there possibly composer failed to generate the folder.

Here is a link to the basic yii2 app: https://github.com/yiisoft/yii2/releases/download/2.0.11/yii-basic-app-2.0.11.tgz

0
On

1 Create/Sign in into github account.

2 Go to Profile>>Settings>>Personal access tokens (OR) click on this https://github.com/settings/tokens.

3 Click on Generate new token

4 Select the appropriate scopes and click Generate token.

5 Copy the the token Key and past it in composer when the composer want you the Token(like: Token (Hidden):)

Now it will enter into the installation process.