Run Slim 3 on Linux


I’m a new user of Slim 3 and can’t run it on my Linux server.

Following that tutorial :
I create a subfolder in my apache directory (there are other websites in folder) and put the code.

When I try to access to folder I got an error.
On Windows Apache, with the command "php -S localhost:8080 -t ./public/ " it works fine

Parse error: syntax error, unexpected '[', expecting ')' in /var/www/scolarit/public/index.php on line 15

Thanks for your help

what’s in your index.php?

start’s by :

use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

require ‘…/vendor/autoload.php’;
require ‘push_helper.php’;

$config[‘displayErrorDetails’] = true;

$config[‘db’][‘host’] = “localhost”;
$config[‘db’][‘user’] = “root”;
$config[‘db’][‘pass’] = “password”;
$config[‘db’][‘dbname’] = “db”;

$app = new \Slim\App([“settings” => $config]); // <-- here is the line 15

$container = $app->getContainer();`

Do you have PHP 5.4 or before?

Before : my version is PHP 5.3.10

PHP 5.5 is the minimum supported version.

Ok I see, thank you.