Slim: Trait 'Slim\CallableResolverAwareTrait' not found

Created on 25 Dec 2015  路  9Comments  路  Source: slimphp/Slim

Hey guys,

I have just downloaded Stable version of Slim3.0.0 available on git, And tried to configure it.

Source Code:

require '../Slim/App.php';

\Slim\Slim::registerAutoloader();
$app = new Slim\App();

$app->get('/', function ($request, $response, $args) {
$response->write("Welcome to Slim!");
return $response;
});

$app->get('/hello[/{name}]', function ($request, $response, $args) {
$response->write("Hello, " . $args['name']);
return $response;
})->setArgument('name', 'World!');

$app->run();

When i tried to run it. it's giving "PHP Fatal error: Trait 'Slim\CallableResolverAwareTrait' not found in ............../app/services/Slim/App.php on line 49".

Please Help.

All 9 comments

Use composer.

Hi akrabat,

Thanks for your quick response,

I am unable to use SSH in my server because i am using shared hosting, So they will not provide me SSH access,

Is there any other way to make it work? I have used your previous release on the same server without using composer. So i am sure there would be another way.

Please help me with it.

Thanks,
Ajay Kumar

You don't need SSH to use Composer. You use Composer locally and FTP the files to your server.

Thanks :+1:

@akrabat What if I don't want to use composer?

@TrySound: Download all the dependencies and put them in your project & then write your own autoloader.

Serious? Well, it's not a good point in v3 release. :(

Composer is the PHP dependency manager. Slim v3 has dependencies and so it uses Composer to manage them. I'm unsure why this could ever be a problem.

Because of community misconception that you need to actual run composer command on your production server (which is not possible for shared servers). Take a look at @akrabat's article if you want to use Slim 3 on shared server https://akrabat.com/using-composer-with-shared-hosting/

Was this page helpful?
0 / 5 - 0 ratings