Point your web browser to 127.0.0.1:84/users.php
That will tell you if you PHP is connecting. You can build up a test string and just use it in the browser.
OliverA is correct. Need to change your port in the PHP file (or just remove it).
$servername = "localhost";
If the environment variable is set you can do it like:
$databasehost = $_ENV{'DATABASE_SERVER'};
If you plan on the app having a lot of users, you probably want to look at being able to store the passwords in encrypted form.