We have figured out a solution for Slim 3. See here:
If you run Slim in a subdirectory you may also have to fix the basePath:
$container['environment'] = function () {
$scriptName = $_SERVER['SCRIPT_NAME'];
$_SERVER['SCRIPT_NAME'] = dirname(dirname($scriptName)) . '/' . basename($scriptName);
return new \Slim\Http\Environment($_SERVER);
};
This working example assumes that you store your front-controller file (index.php) under: {project-root}/public/index.php