simple php Slim project errors

I’ve created a simple Slim microframework project using PHPStorm 8 on Windows 8.1 with WAMP Server installed. All WAMP Server settings are set by default.

I created a new project called pr1
I used 'Init Composer...' and then added some dependencies like slim/slim, slim/views, twig/twig.

Then I tried to create a simple application just like a given example on main Slim page:

  1. I’ve created file called index.php in my project folder
    index.php

code:

require 'app.php';
  1. Then I’ve created file app.php

code

require 'vendor/autoload.php';

$app = new SlimSlim();

$app->get('/:name', function ($name) {
   echo "Hello, $name";
});

$app->run();
  1. After this I tried to run my project in Chrome and there an error 404 occured.

PHPStorm Error

  1. Then I tried to pass my name through url: http://localhost:63342/pr1/wade and there was PHPStorm error.

phpstorm error

  1. After this steps I’ve tried to close PHPStorm and my project in browser:

Slim error

and it seemed like there’s a typical Slim 404 error,but when I tried to pass my name through url again it gave me this error:

wamp 404 error


Source: wampserver

Leave a Reply