title: How to connect to PostgreSQL DB with PHP?
body: <p>As you can already see in the title I want to connect to a PostgreSQL Database I created on a server using PHP and Yii2. Unfortunately I am a total novice when it comes to this kind of job and I have never done it before so I have several questions that I hope some of you can answer.</p>
  <ol>
  <li>I am using Yii2 basic and in the config directory there is a <code>db.php</code> file containing the following code:</li>
  </ol>
  <pre><code>    return [
          'class' =&gt; 'yii\db\Connection',
          'dsn' =&gt; 'pgsql:host=localhost;dbname=my1DB',
          'username' =&gt; 'root',
          'password' =&gt; '',
          'charset' =&gt; 'utf8',
      ];
  </code></pre>
  <p>Is the code actually OK? Instead of localhost I will be using the host IP of course. The db <code>my1DB</code> is actually created and already contains a relation named <code>countries</code>.</p>
  <ol start="2">
  <li>I have Yii2 basic installed on my client. Now my question is, do I need to install it on the server as well? It may be a dumb question and I am truly sorry if it is, but I am not sure if I am understanding it all correctly. So, does the <code>db.php</code> file need to be on the server? Or is it OK if it is simply installed on my client?</li>
  </ol>