Error Establishing a Database Connection
For some reason, my Bitnami WordPress install on AWS kept throwing errors — even though everything in my wp-config.php
looked fine, and the database was accessible.
What followed was an unnecessarily exciting and time-consuming wild goose chase… only to discover the issue had a simple fix: I just needed to restart Apache — or more precisely, restart the Bitnami services.
Since I use PhpStorm for my web development, I started an SSH session directly from my project root using “Start New SSH Session in Directory”. This opened a terminal where I could issue commands directly to the web server.
(If you don’t use PhpStorm, you can connect just as easily using an SSH client like PuTTY, or via your terminal with the ssh
command — whatever fits your workflow.)
Naturally, I assumed the standard command would work:
But nope — that’s not how Bitnami does things.
Bitnami uses its own script to manage services, which is both convenient and easy to overlook if you’re used to traditional Linux setups. Their documentation is helpful, but here’s what finally worked for me:
To stop Apache (or other services):
To restart all services, which is usually safer:
Moral of the story? If you’re running WordPress on Bitnami, always remember: Bitnami has its own way of doing things — and it starts with ctlscript.sh
.
[addtoany]