Need help to install yii2 application advanced tem

2020-06-18 03:27发布

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)

标签: php yii2
8条回答
迷人小祖宗
2楼-- · 2020-06-18 04:20

A php component might be missing, i installed mbstring, then restarted the whole process.

yum -y install php54w_mbstring
composer init
composer create-project --prefer-dist 
              --stability=dev yiisoft/yii2-app-basic <project-name>
查看更多
来,给爷笑一个
3楼-- · 2020-06-18 04:23

If you want to install Yii2 advanced template go to http://www.yiiframework.com/download/ and download the Yii 2 with advanced application template. Once you have extracted the archive file in the www folder. Then Go to Terminal(For Ubuntu) or cmd(Windows user)

  1. For Ubuntu- provide root to the extracted folder(advanced) in the Terminal cd var/www/html/ashish/advanced

  2. Now give the commond- php init

  3. Now advance template is installed properly
查看更多
登录 后发表回答