title: Providing DB credentials via environment and not hard coded
body: <p>I am creating a web application and need to connect to a MySQL database. I am currently using PHP 7.3. I am connecting to the SQL database using PDO standard way (<code>new PDO(DB_DSN, DB_USER, DB_PASS)</code>) but I have been told the following statement:</p>
  
  <blockquote>
    <p>Database credentials should be coming from the environment and not be hard-coded in the source code.</p>
  </blockquote>
  
  <p>However, I am unsure how to do this.</p>
  
  <p>Currently, the application is being hosted on a Linux server but is being migrated to an Azure server. But before we can migrate it, they would like me to change the SQL credential configuration as stated above.</p>
  
  <p>I am current using the class provided in the PHP documentation comments found <a href="https://www.php.net/manual/en/book.pdo.php#93178" rel="nofollow noreferrer">here</a>.</p>