title: symfony 3.4 "An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known"
body: <p>Hello I'm trying to deploy my project in AWS EC2 and RDS. we developed our application using Symfony 3.4 Framework, my code in localhost is working fine with no issues.</p>
  
  <p>After Hosted in AWS is not working. showing this error </p>
  
  <pre><code> "message": "An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known",
  </code></pre>
  
  <p>Postman Error message:</p>
  
  <pre><code>{
      "error": {
          "code": 500,
          "message": "Internal Server Error",
          "exception": [
              {
                  "message": "An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known",
                  "class": "Doctrine\\DBAL\\Exception\\ConnectionException",
                  "trace": [
                      {
                          "namespace": "",
                          "short_class": "",
                          "class": "",
                          "type": "",
                          "function": "",
                          "file": "/var/www/html/ApartmentManagementScms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php",
                          "line": 93,
                          "args": []
                      },
  
                  ]
              },
  
  
          ]
      }
  }
  </code></pre>
  
  <p>Apache Version in AWS:</p>
  
  <pre><code>Server version: Apache/2.4.18 (Ubuntu)
  Server built:   2018-06-07T19:43:03
  </code></pre>
  
  <p>OS version:</p>
  
  <pre><code>    Distributor ID: Ubuntu
      Description:    Ubuntu 16.04.5 LTS
      Release:    16.04
      Codename:   xenial
  </code></pre>