Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

olamilekan oshodi
olamilekan oshodi
959 Points

PHP Slim composer - Not Found

Hello, Am just in the middle of Build A Basic PHP Website and Hempton was using Slim Framework, everything is going fine until i get to installing Slim. Hempton used v2 in the tutorial and have manage to include the "^3.0" in my composer.json file.

here:

{
    "name": "root/workspace",
    "require": {
        "slim/slim": "^3.3"
    },
    "authors": [
        {
            "name": "Olamilekan Oshodi",
            "email": "*****ter@gmail.com"
        }
    ]
}

Here is the my index file code.

<?php

require 'vendor/autoload.php';
//date_default_timezone_set('Europe/London');


//$log = new Monolog\Logger('name');
//$log->pushHandler(new Monolog\Handler\StreamHandler('app.txt', Monolog\Logger::WARNING));

// installing Slim Framework
$app = new Slim\App();

// Slim Framework routing
$app->get('/hello/{name}', function ($name) {
    echo "Hello, $name";
});

$app->run();

//here is the error am getting.
Fatal error: Uncaught Error: Class 'Slim\App' not found in /home/treehouse/workspace/index.php:11 Stack trace: #0 {main} thrown in /home/treehouse/workspace/index.php on line 11

Is there some thing am not adding to it, or missing? please help.

Hey! I'm sorry but I don't much about using Slim. Here is a support page for Slim:

Slim support page

I hope this helps.