在web服务器内置的php中运行symfony 2项目

I'm trying to create and run a Symfony 2 (2.5) project on Netbeans with built in php web server, I've added the following router script.

> if (isset($_SERVER['SCRIPT_FILENAME'])) {
    return false;
} else {
    $_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT']
        . DIRECTORY_SEPARATOR
        . 'app.php'
    ;
    require 'app.php';
}

However when I run the project it always returns the following response.

Not Found The requested resource / was not found on this server.

Could anyone advise? Thanks.

If you run Symfony the best way IMHO is to use Symfony's bundled script for built-in server. It works with command php app/console server:run.