{“success”:false,“message”:“Could not connect to server, please try again later”,“data”:null}
Other Information
Hello,
I’m hosting a PHP-based REST API on my InfinityFree account (domain: apimyapp.kesug.com). My backend needs to connect to an external PostgreSQL database (hosted on a third-party provider) using the PDO_PGSQL extension over the standard port (5432).
When I try to connect, the connection fails / times out, and I get a generic connection error from my own error handling.
Could you please help me confirm:
Does my hosting plan support outbound connections to external database servers (not hosted on InfinityFree)?
Is the pdo_pgsql / pgsql PHP extension enabled on my account?
If outbound external DB connections are blocked by policy, is there any way (even on a paid/premium plan) to allow this?
As I understand it there is a block on many outbound ports, that would prevent you being able to connect to a remote database.
Additionally, the hosting here is designed for websites not API’s so even if it did work, any non-browser trying to access your site would be blocked by the security system
I’m not completely sure about outbound connections, but premium hosting does support PostgreSQL hosting, which means that the required PHP extensions are available too.
Ignoring the Postgres connection issues, this wouldn’t work in the first place. But also here applies: premium hosting is the solution, this is a free hosting only restrictions.