PhpStorm and Slim

Hi. I installed PhpStorm and add composer. However I have some errors:

What I am doing wrong?

First thing is that the ‘require’ paths seem to be wrong - try variations of…

require dirname(__DIR__) . '/vendor/autoload.php';

or

require dirname(__DIR__) . '../vendor/autoload.php';

Think about where the calling file is located and what the relative path is to the autoload.

Some of the other errors follow on from that; because phpstorm cannot find autoload.php - it does not yet know about \Slim\App namespace.

1 Like