Showing slim 3 error stacktrace on Apache2

So I’ve finally managed to configure virtual hosts on my local machine, and could thus use custom domain names for my slim apps. Of course, I’m currently just learning.

However, I’ve run into a bit of an issue. It seems error stack traces don’t really show… I’ve enabled error logging:

$configuation = [
‘settings’ => [‘displayErrorDetails’ => true,],
];

$config = new \Slim\Container($configuation);

$app = new \Slim\App($config);

However, this does not seem to show syntax errors. I use Ubuntu 16.04 LTS. My question is if it possible to allow Slim to show a stacktrace on syntactical (and other) errors, while run as a virtual host on the Apache2 web server.

I couldn’t find any leads at all when it came to enabling error logging on the apache server for this framework. In fact, compared to most other popular frameworks, relevant results for Slim 3 for any general query seemed lower, and part of it is only relevant for Slim 2…

What you need to do is enable/install XDebug :slight_smile:

Or if you use a decent IDE like PHPStorm, it will highlight your syntax errors.

1 Like

Omg thanks! I’m dead sure I wouldn’t have got to this in a week if I only relied on google…
Again, thanks. I’ll go and install XDebug right away. I would of gotten PHPStorm if I had the money. Haha.

PHPStorm offers an Early Access Program which is free to use. I would highly recommend it.

If you are still unsure, take a look at NetBeans as they have a PHP Version which is free to use as well.

1 Like

Yeah, I can recommend PhpStorm. It’s the best of all IDE’s I’ve tried …

1 Like