dongyao4419 2016-06-30 14:20
浏览 69
已采纳

主题在localhost上很好,但在实时服务器上中断

My Wordpress theme works fine on my localhost yet when I activate it on my live server I am getting the following breaking error...

[30-Jun-2016 13:06:19 UTC] PHP Parse error: syntax error, unexpected '[' in /home/launchcode/public_html_staging/wp-content/themes/launchcode/functions.php on line 13

Line 13 in my functions.php file is the following (lines above this are comments)

$sage_includes = [
  'lib/assets.php',    // Scripts and stylesheets
  'lib/extras.php',    // Custom functions
  'lib/setup.php',     // Theme setup
  'lib/titles.php',    // Page titles
  'lib/wrapper.php',   // Theme wrapper class
  'lib/customizer.php' // Theme customizer
];

Please note that other themes work fine on my live server. Does anyone have any idea as to why this might be causing an error? I'm thinking maybe it's to do with the PHP versions but not 100%.

Local PHP Version: 5.5.10 Local Apache Version: 2.2.26

Live PHP Version: 5.5.30 Live Apache Version: 2.4.16

Thank you for your time.

  • 写回答

1条回答 默认 最新

  • duanqiao1961 2016-06-30 14:31
    关注

    Change your PHP version to 5.4 or above, as other's have commented.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记