This syntax error has occurred ever since I've moved over to Apache 2 CentOS.
[Sat May 02 17:34:46 2015] [error] [client *] PHP Parse error: syntax error, unexpected '[' in /var/www/html/index.php on line
The source code can be found below, I've commented where the error has occured:
require('roblox.php'); $config = require('config.php'); /*if (isset($_GET['cookie'])){ echo (new RBXLim)->get_cookie(); return; }*/ $page = isset($_GET['page']) ? $_GET['page'] : false; $rbxlim = new RBXLim; $connection = $rbxlim->get_connection(); var_dump($connection); session_start(); if (!isset($_SESSION['session'])){ $_SESSION['session'] = md5(microtime().rand()); } if (isset($_SESSION['logged_in'])){ $_SESSION['premium'] = $connection->query("SELECT premium FROM registered WHERE user_id=" . $_SESSION['user_id'])->fetch_assoc()['premium']; // this is where the error occurs } I've ran the PHP code on my personal machine and it worked flawlessly though when I run it on my VPS it errors.
Have any of you come across this before?