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

主题在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
    duanqiao1961 2016-06-30 14:31
    已采纳

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

    点赞 评论

相关推荐