Error 500 on a working docker container
Asked Answered
L

1

6

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

Locution answered 26/10, 2017 at 0:11 Comment(9)
The PHP environment in your docker container is not set to display errors. It appears to be in more of a production modeElenor
all I have done is setup the .env with php 5.6 and my application path then docker-compose up -d nginx mariadbLocution
Have you tried viewing the log files?Elenor
no, but all I want is to have a more verbose error details.Locution
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"Locution
but how can I display this on chrome?Locution
Change display_errors to OnElenor
Awesome man, its working. just post your answer so I can vote for you.Locution
I'm not particularly familiar with the laradock configuration. You should probably write what you did in an answer to this question.Elenor
L
13

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.

Locution answered 26/10, 2017 at 11:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.