Cannot use yii\base\Object as Object because 'Object' is a special class name
2018-03-06 00:00
537 查看
摘要: php7使用yii的gii报错处理
如图:
在php7中,已经不允许object做为一个类名了,这成了它的关键字了。
修改方法:
第一,先将composer修改为国内镜像。要不然,慢死你
第二步,。更新yii版本号:
如果还不能用的话,仔细看错误信息。找到yii-gii下的codefile下的object,你会发现php7下的object为灰色。看下图:
然后即可
如图:
在php7中,已经不允许object做为一个类名了,这成了它的关键字了。
修改方法:
第一,先将composer修改为国内镜像。要不然,慢死你
composer config -g repo.packagist composer
第二步,。更新yii版本号:
composer require yiisoft/yii2 版本号
如果还不能用的话,仔细看错误信息。找到yii-gii下的codefile下的object,你会发现php7下的object为灰色。看下图:
然后即可
相关文章推荐
- PHP“Cannot use object of type stdClass as array”
- PHP“Cannot use object of type stdClass as array”
- PHP 错误:Cannot use object of type yii\db\Command as array
- 使用json_decode()转换返回数组或对象时出现:Cannot use object of type stdClass as array
- php “Cannot use object of type stdClass as array” 的解决方法
- PHP错误Cannot use object of type stdClass as array in错误的解决办法
- PHP JSON出错:Cannot use object of type stdClass as array解决方法
- Cannot use object of type stdClass as array
- PHP中遍历stdclass object 报错Fatal error: Cannot use objectof type stdClass as array
- php7环境下ThinkPHP报错:Cannot use 'String' as class name as it is reserved
- PHP“Cannot use object of type stdClass as array”
- Cannot declare class app\home\controller\Cases because the name is already in use
- Cannot use object of type yii\db\Connection as array
- json_decode(Cannot use object of type stdClass as array)
- PHP“Cannot use object of type stdClass as array”
- PHP“Cannot use object of type stdClass as array”
- PHP“Cannot use object of type stdClass as array”
- PHP“Cannot use object of type stdClass as array” (php在调用json_decode从字符串对象生成json对象时的报错)
- php错误 Fatal error: Cannot use object of type stdClass as array in……
- PHP报错:Cannot use object of type stdClass as array