layui-admin
layui-admin copied to clipboard
php 7.4数据库迁移最后一步有错误提示
[InvalidArgumentException] There was a problem creating the schema table: SQLSTATE[42000]: Syntax erro r or access violation: 1067 Invalid default value for 'end_time'
xampp可以通过修改my.ini:
my.ini 接下來搜尋 sql_mode,將原本的 sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION 修改成 sql_mode= 然後重啟即可解決~
对于php7.4仍有以下提示:
[think\exception\ErrorException] Trying to access array offset on value of type null
估计是:有个地方在访问数组元素,而数组本身却是null。在Php这种弱类型语言中这种语法一般是支持的,它会整体返回null,而在新版的Php7.4中这个语法却会报告为错误。
不知道如何修改