Having a strange issue with pdo connection - only on locahost server.
(Live websites work perfectly so not a coding error)
I can only connect to certain remote databases.
These two are both setup on a godaddy server.
The first connection connects perfectly but the 2nd url fails. It appears to be related to the database url.
[02-Jul-2018 17:30:03 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
This piece doesn’t look right. I’ve always thought there was never a semi colon after the database name. Also, I don’t think you can connect to a remote database unless you allow permissions.
I have removed the semi-colon and still no connection.
I am able to connect remotely as this was working perfectly before.
The only change has been a switch from a Sky router to a Virgin media router.
I can still connect with some sites as stated in the first example A, and using exactly the same coding to connect.
The 2nd URL is causing problems on many databases.
Like I said. Removing the semi colon is for proper syntax. But the main problem is that you cannot connect locally to a remote database unless you give the localhost permissions.
Permissions exist.
I was always able to connect and test every website under a local host environment.
I have not changed the URLs, and have not changed any coding. My router must be accepting the correct ports as I can connect to hostedresource.com but every site tested with a .net extension fails.