I'm trying to implement a CMS on AWS using mostly free tier services and am doing so using PHP, and have already implemented this using PHPMyAdmin in school.
I wanted to do this using RDS, but I've come up with a pretty strange issue.
When I upload my site to Elastic Beanstalk and try to connect to the DB from there, I face incredibly long wait times. Sometimes it returns error 504 from long wait times.
This is not an issue with the Database's speed, however. I know this because I can run this code on localhost and it works exactly as intended (see photo)
Only half a second to load!
What I think is happening:
Something must be going on while it's being executed in Elastic Beanstalk. I don't know quite what, but it's taking way too long.
I connect to the DB using the following code (credentials are spoofed):
$conn = mysqli_connect("mydb.cebelvm3fa0n.ca-central-1.rds.amazonaws.com","USERNAME","PASSWORD","mydb");
Both my database and EL instance are run from ca-central. The connection is not failing, it is taking an extreme amount of time.
the page that is failing is http://howardpearce.ca/posts.php
If you have any ideas on what it could be, I would appreciate it very much. Thanks!
I will post certain bits of my code, but creating an MCVE is really not feasible as I would have to give my DB password, and you would need to re-create my AWS environment, so please don't ask for one, I can always give more detail.