typecho安装的时候打开提示错误

Bug,需求以及想法
回复
hb199718
帖子: 2
注册时间: 2018年 1月 17日 14:22

typecho安装的时候打开提示错误

帖子 hb199718 »

错误提示这个
Parse error: syntax error, unexpected '[', expecting ')' in /home/ftp/s/s7998829/wwwroot/blog/install.php on line 242

对应的打开文件对应的代码是
<?php
$db->query($db->update('table.options')->rows(['value' => 1])->where('name = ?', 'installed'));
?>

请问这是什么原因,想直接下载的源码就出现这个问题!

用的是虚拟机!
vainl
帖子: 3
注册时间: 2013年 12月 21日 17:00

Re: typecho安装的时候打开提示错误

帖子 vainl »

http://php.net/manual/zh/language.types.array.php
自 5.4 起可以使用短数组定义语法,用 [] 替代 array()。


解决方法:使用 PHP版本 >= 5.4
或者修改所有代码中的数组结构 [] => array()
例如,以上错误需要修改 ['value' => 1]array('value' => 1)
回复