|-转 Yii2给数据库表添加字段后对应模型无法识别到该属性的原因和解决办法
应为数据库表的结构被缓存了。删除runtime文件夹或者执行
//清理指定表结构缓存数据
Yii::$app->db->getSchema()->refreshTableSchema('{{%post}}');//这里post是出去表前缀的表名 //清理所有表结构缓存数据 Yii::$app->db->getSchema()->refresh();...
|-原 karpoff\icrop\CropImageUpload 使用中遇到的问题CropImageUploadBehavior is not found for some attribute
Invalid Configuration – yii\base\InvalidConfigException
CropImageUploadBehavior is not found for photo_code attribute
报错
Invalid Configuration – yii\base\InvalidConfigException
CropImageUploadBehavior is not found for photo_code attribute
找到源代码,看到错误是throw new InvalidConfigException("CropImageUploadBehavior is not found for {$this->attribute} attribute");这里抛出的,再看下这一区块的代码。...
|-原 Yii2用QueryList采集时报错,Fatal error: Array and string offset access syntax with curly braces is no longer supported
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /data/www/default/wokan/vendor/jaeger/phpquery-single/phpQuery.php on line 2166
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /data/www/default/wokan/vendor/jaeger/phpquery-single/phpQuery.php on line 2166
就是这段代码 ...
|-原 PHP报错Undefined constant "Socket\Raw\AF_INET"的原因以及解决方法
|-原 PHP报错The each() function is deprecated. This message will be suppressed on further calls
in D:\phpstudy\WWW\wokan\vendor\jaeger\querylist\QueryList.php
The each() function is deprecated. This message will be suppressed on further calls...
|-原 Yii报错Syntax error or access violation: 1142 DROP command denied to user
Database Exception – yii\db\Exception
SQLSTATE[42000]: Syntax error or access violation: 1142 DROP command denied to user 'test'@'localhost' for table 'test_table'
The SQL being executed was: truncate table test_table
Error Info: Array
(
[0] => 42000
[1] => 1142
[2] => DROP command denied to user 'test'@'localhost' for table 'test_table'
)
The SQL being executed was: truncate table test_table...
|-摘 Yii 配置中设置mysql端口号其实很简单,请看下面的代码
'db' => array(
'class' => 'yii\db\Connection',
'connectionString' => 'mysql:host=localhost;dbname=phpac',
'username' => 'root',
'password' => '123456',
),
这是修改后的Yii的mysql配置代码
'db' => array(
'class' => 'yii\db\Connection',...