Fatal error: Class 'Slim\App' not found

Hello all,

I know this problem has been encountered before, for example here:

but I’m not sure how to resolve it in my case.

I’m running Slim 2.6.1 which was installed by composer

my composer.json reads:
“require”: {

    "slim/slim": "2.*"

}, 

My folder structure is

project
vendor
www
index.php

The index.php file I copied from your quick start example and reads:

<?php use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; require '../vendor/autoload.php'; $app = new \Slim\App; Other users who have complained of this issue seem to either install the wrong version manually or not require the autoloader. I've checked and Slim.php is installed in vendor, although it is several layers deep. If I try to manually require Slim.php I run into exactly the same error. Any advice would be appreciated. Thanks, Brendan

Okay, I think I solved PART of my problem.

Apparently $app = new \Slim\App; is version 3 syntax and version 2 should be $app = new \Slim\Slim();

Now I’m getting a 404 instead of a fatal error, so that’s progress…

Aha, got it. 404 was an apache issue. Resolved.