5

I'm using a slimframwork 3 app on laradock (nginx, mariadb, phpfpm, php 5.6) so I made a stupid syntax error:

$view->addExtension(new \Slim\Views\TwigExtension(
$container->router,
$container->request->getUri(),
));

the comma after the getUri() was giving me error 500 on chrome and that was frustration so I tried my app on wamp on windows and I get:

Parse error: syntax error, unexpected ')' in C:\wamp64\www\app\bootstrap\app.php on line 21

why was I having a 500 error with no clue of what was wrong.

P.S. I've set displayErrorDetails to true

Getsuga
  • 388
  • 4
  • 16
  • The PHP environment in your docker container is not set to display errors. It appears to be in more of a *production* mode – Phil Oct 26 '17 at 00:22
  • all I have done is setup the .env with php 5.6 and my application path then docker-compose up -d nginx mariadb – Getsuga Oct 26 '17 at 00:25
  • 1
    Have you tried [viewing the log files](http://laradock.io/documentation/#view-the-log-files)? – Phil Oct 26 '17 at 00:26
  • no, but all I want is to have a more verbose error details. – Getsuga Oct 26 '17 at 00:29
  • You're right Phil, I've checked my php-fpm logs and found this: 172.20.0.6 - 26/Oct/2017:00:39:31 +0000 "GET /index.php" 500 [26-Oct-2017 00:39:31] WARNING: [pool www] child 8 said into stderr: "NOTICE: PHP message: PHP Parse error: syntax error, unexpected ')' in /var/www/bootstrap/app.php on line 21" – Getsuga Oct 26 '17 at 00:42
  • but how can I display this on chrome? – Getsuga Oct 26 '17 at 00:43
  • 1
    Change [`display_errors`](https://github.com/laradock/laradock/blob/master/php-fpm/laravel.ini#L2) to `On` – Phil Oct 26 '17 at 01:07
  • Awesome man, its working. just post your answer so I can vote for you. – Getsuga Oct 26 '17 at 01:35
  • 1
    I'm not particularly familiar with the laradock configuration. You should probably write what you did in an answer to this question. – Phil Oct 26 '17 at 02:34

1 Answers1

7

Shoutout to Phil who solved this issue.

So when you use laradock and you come to a situation like this and you want more specific details about the error, you can either check your php-fpm container logs with:

docker logs -f <your container>

or set the "display_errors=On" on laradock/php-fpm/laravel.ini and you'll see your error message on your browser instead of error 500.

Getsuga
  • 388
  • 4
  • 16