local wordpress multisite not working on AWS development server "error establishing database connection"
I have a composer WP starter installation on my local mac using mamp. It works as expected. I'm using phpdotenv to hide my wp-config.php settings and I have the wordpress directory moved into a sub-directory under document root. I use a virtual host on the local mac dev2.domainname.com. I used wp db migrate pro to find and replace dev2 to dev3 as the domainname.com is the same on local and AWS. The only other difference is the database connection settings. I know the database connection settings are correct as I use them in the shell script that runs composer and installs wp using wp-cli. The script runs perfectly. But for some reason and I have looked at httpd.conf, .htaccess, .env settings, everything I can think of I get "error establishing a database connection". Any ideas on where to look or how to diagnose the problem? Thx