Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help to install yii2 application advanced template

Tags:

php

yii2

I'm new to Yii2, now I'm trying to install yii2 application advanced template.

I did follow these steps:

1 - Download yii2-app-advanced zip file from https://github.com/yiisoft/yii2-app-advanced

2 - Follow GETTING STARTED guide:

 + I'm using Uniform Zero Server (installed in F disk with the path "F:\Server\UniServerZ\www") ok.
 + I creted new folder with name "yii2" in the "www" directory ("F:\Server\UniServerZ\www\yii2")
 + I extracted zip file yii2-app-advanced into "yii2" folder (Every source of yii2-app-advanced now in "yii2" folder so it is the root directory of yii2-app-advanced)
 + Click init.bat file to run "init" and select (0 - Developer mode) and type "yes" to confirm. Done
 + And then I click the yii.bat file, but nothing happened.
 + I tried use this url : localhost/yii2/backend/web/                
   And I get this Error:
   Fatal error: require(): Failed opening required 'F:\Server\UniServerZ\www\yii2\backend\web/../../vendor/autoload.php' (include_path='.;F:/Server/UniServerZ/home/us_pear/PEAR') in F:\Server\UniServerZ\www\yii2\backend\web\index.php on line 5
                   or url : localhost/yii2/frontend/web/ 
   And I get this Error too:
   Fatal error: require(): Failed opening required 'F:\Server\UniServerZ\www\yii2\frontend\web/../../vendor/autoload.php' (include_path='.;F:/Server/UniServerZ/home/us_pear/PEAR') in F:\Server\UniServerZ\www\yii2\frontend\web\index.php on line 5 
  • I checked the "vendor" directory follow this path: F:\Server\UniServerZ\www\yii2\vendor But it's empty.

So what should I do to fix this error and install yii2 application advanced template?

(My Uniform Server runs PHP5.4)

like image 817
user3160078 Avatar asked Jan 04 '14 11:01

user3160078


2 Answers

Yii2 Installation Following command:

(1) First install Composer (LINUX):

Locally:

curl -sS https://getcomposer.org/installer | php

OR

(1) First install Composer (WINDOWS):

C:\Users\username>cd C:\bin

C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php

Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini

C:\bin>echo @php "%~dp0composer.phar" %*>composer.bat

C:\Users\username>composer -V

Composer version 27d8904


(2) Yii2 framework online downloads:

Basic App:

php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta

Advanced App:

php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta


(3) Other App Settings Command:

php init

php yii migrate

like image 117
Bharat Chauhan Avatar answered Oct 14 '22 08:10

Bharat Chauhan


If you are working on linux, go to the downloaded project and in the terminal type (if you have a composer):

php composer.phar install

If the composer is not installed go to https://getcomposer.org/download/ After this, yii2 framework and other extensions will be installed at vendor directory. This should fix the problem

like image 31
Oleksandr Mosur Avatar answered Oct 14 '22 08:10

Oleksandr Mosur