yii2擴充套件yii2 imagine遇到的問題

2021-07-10 09:31:21 字數 1244 閱讀 4236

最近在使用yii2移植**時,在縮圖那裡卡了兩天,幾乎搞得想崩潰,但經過我不屈不撓的努力,終於成功搞定!

剛開始一直按照網上的教程,在cmd使用命令列安裝,

php composer.phar require --prefer-dist yiisoft/yii2-imagine 

ps:附上該方法教程:

但是一直沒有成功,主要是出現以下問題,

deprecation notice: the composer\package\linkconstraint\multiconstraint class is deprecated, use                  

composer\semver\constraint\multiconstraint  instead.inphar:///usr/local/bin/composer/src/composer/package/linkconstraint/multiconstraint.php:17

deprecation notice: the composer\package\linkconstraint\linkconstraintinte***ce inte***ce is deprecated, use  composer\semver\constraint\constraintinte***ce          

instead. in  phar:///usr/local/bin/composer/src/composer/package/linkconstraint/linkconstraintinte***ce.php:17

然後跳出個錯誤

illegal offset type in isset or empty

最後 安裝失敗。

經過努力終於找到了解決方法,如下:

這其實是: fxp/composer-asset-plugin  相關的乙個bug,你在global require的時候,用1.1的beta版就沒問題了。

解決方法,首先在cmd上輸入

composer global require "fxp/composer-asset-plugin:~1.1.1" 

然後在cmd上輸入

composer install

就ok了。當然有乙個前提,你需要先安裝了git軟體,並且新增了系統變數,不然依然無法成功。現附上方法。

5、需要以管理員身份執行cmd

Yii2 配置yii2 redis擴充套件

前提 已經安裝redis。一 包檔案安裝 yiisoft yii2 redis extentions.php然後配置vender yiisoft extensions.php檔案 yiisoft yii2 redis array name yiisoft yii2 redis version 2.0...

Yii2 配置yii2 redis擴充套件

前提 已經安裝redis。一 包檔案安裝 yiisoft yii2 redis extentions.php 然後配置vender yiisoft extensions.php檔案 yiisoft yii2 redis array name yiisoft yii2 redis version 2....

Yii2 裡使用Redis擴充套件

redis是個很不錯的nosql資料庫,比memcached的好處是能持久化資料。yii2裡使用redis 首先要擴充套件redis。可以在composer.json 裡新增 redis require 然後使用命令 composer update,或者直接使用命令 composer update ...