Search code examples
phpdoctrine-ormsymfony-3.1

Symfony3 The server returned a "500 Internal Server Error"


I wanted to put my symfony3 code to hosting and after all i got

Oops! An Error Occurred

The server returned a "500 Internal Server Error".

Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

my parameters.yml

# This file is auto-generated during the composer install

parameters:

database_host: db.if.ktu.lt
database_port: null
database_name: lukmil
database_user: lukmil
database_password: "MyPassword"
mailer_transport: smtp
mailer_host:       127.0.0.1
mailer_user:       ~
mailer_password:   ~
secret: ThisTokenIsNotSoSecretChangeIt

that's what i get from prod log

[2016-10-11 18:18:40] request.INFO: Matched route "{route}". {"route":"authentication_register","route_parameters":{"_controller":"AppBundle\Controller\DefaultController::indexAction","_route":"authentication_register"},"request_uri":"http://lukmil.stud.if.ktu.lt/register","method":"GET"} [] [2016-10-11 18:18:40] security.INFO: Populated the TokenStorage with an anonymous Token. [] [] [2016-10-11 18:18:40] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occured in driver: SQLSTATE[28000] [1045] Access denied for user 'root'@'stud.if.ktu.lt' (using password: NO)" at /home/lukmil/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 103 {"exception":"[object] (Doctrine\DBAL\Exception\ConnectionException(code: 0): An exception occured in driver: SQLSTATE[28000] [1045] Access denied for user 'root'@'stud.if.ktu.lt' (using password: NO) at /home/lukmil/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:103, Doctrine\DBAL\Driver\PDOException(code: 1045): SQLSTATE[28000] [1045] Access denied for user 'root'@'stud.if.ktu.lt' (using password: NO) at /home/lukmil/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47, PDOException(code: 1045): SQLSTATE[28000] [1045] Access denied for user 'root'@'stud.if.ktu.lt' (using password: NO) at /home/lukmil/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43)"} []

What could I do? On localhost it worked.. just in hosting doesn't


Solution

  • Ok, I found a fix.. I downloaded putty program then logged in and use php bin/console cache:clear --env=prod with clearing the cache my problem solved :)