<?php

if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
    return false;
}

require 'vendor/autoload.php';

Zend\Mvc\Application::init(require 'config/application.config.php')->run();

<?php chdir(dirname(__DIR__));

if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
    return false;
}

require 'vendor/autoload.php';

Zend\Mvc\Application::init(require 'config/application.config.php')->run();

Change directory to project root before bootstrapping
Change directory to project root before bootstrapping 