yii項目開發配置

  • Clone項目

git clone https://gitee.com/s***/dianshang.git
  • 安裝yii

php ini

選擇 [0] Developmentphp

  • 安裝擴展

copy composer.json 至 項目根目錄,爲安裝對應擴展作準備html

composer install

可能會提示報錯一下信息:jquery

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable
 | 1.11.*@stable | 1.12.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.8 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable
 | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable
 | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stabl
e -> no matching package found.
    - yiisoft/yii2 2.0.15.1 requires bower-asset/jquery 3.2.*@stable | 3.1.*@sta
ble | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching
 package found.
    - yiisoft/yii2 2.0.15 requires bower-asset/jquery 3.2.*@stable | 3.1.*@stabl
e | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching p
ackage found.
    - yiisoft/yii2 2.0.14.2 requires bower-asset/jquery 3.2.*@stable | 3.1.*@sta
ble | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching
 package found.
    - yiisoft/yii2 2.0.14.1 requires bower-asset/jquery 3.2.*@stable | 3.1.*@sta
ble | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching
 package found.
    - yiisoft/yii2 2.0.14 requires bower-asset/jquery 3.2.*@stable | 3.1.*@stabl
e | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching p
ackage found.
    - yiisoft/yii2 2.0.13.3 requires bower-asset/jquery 3.2.*@stable | 3.1.*@sta
ble | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching
 package found.
    - yiisoft/yii2 2.0.13.2 requires bower-asset/jquery 3.2.*@stable | 3.1.*@sta
ble | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching
 package found.
    - yiisoft/yii2 2.0.13.1 requires bower-asset/jquery 3.2.*@stable | 3.1.*@sta
ble | 2.2.*@stable | 2.

運行一下已解決此問題:git

composer global require "fxp/composer-asset-plugin"

而後再進行安裝更新:github

使用 Composer 的時候提示輸入 Token,解決辦法:

進入 https://github.com/settings/tokens 點擊 「Generate new token」 新建一個 Token,選擇默認新建就行,而後就會獲得一個 Token,而後輸入這個值就 OK 了。web

 

  • Apache配置

<Directory "D:\項目名\web">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all Require all granted  
    #add  RewriteEngine on # 若是請求的是真實存在的文件或目錄,直接訪問 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # 若是請求的不是真實文件或目錄,分發請求至 index.php RewriteRule . index.php
    #add end </Directory>

 

參考地址:json

安裝擴展問題: http://www.updateweb.cn/zwfec/item-95.htmlyii2

提示輸入token問題: https://blog.csdn.net/u012993454/article/details/49177291composer

相關文章
相關標籤/搜索