An Hostinger host a PHP/MySQL chat API for a portal on another host?

Website URL

https://brgyburol3ims.freedev.app

Error Message

No current error. I’m asking whether this setup is permitted before deployment.

Other Information

I’m considering Hostinger Web Hosting for only the backend of a support-chat feature. The portal pages and user login will remain on InfinityFree. The backend would be a custom PHP API with a MySQL database, accessed by residents and clerks from the portal over HTTPS using normal HTTP requests and polling, not WebSockets.

This is for a barangay public-service portal and would store residents’ support messages. Is this permitted under your hosting terms, and is a shared web-hosting plan suitable for this PHP/MySQL API? Are there any restrictions on browser requests from another origin, or data-handling requirements we should know before using real messages?

The part you need to understand is that doing live chat with PHP and polling is always going to be a suboptimal solution. Firing up a fresh PHP process for every user every second or so and querying the database for new messages is inherently an very inefficient way to do messaging. It’s an inherent issue with the choice of technology, regardless of where you host it.

On our free hosting, it’s prohibited and blocked outright. On iFastNet’s premium hosting, it’s still prohibited, but not actively blocked. I don’t know Hostinger’s terms regarding live chat scripts.

But even if PHP live chat is allowed and not blocked, it’s still heavy on the servers, which means it will use a lot of your account’s available system resources (hits, CPU, memory, entry processes). And a hosting provider may still intervene if the live chat puts unreasonable stress on the server. Even if they don’t prohibit live chat specifically, they will still prohibit unreasonable usage.


As for your question “is this setup permitted”, it depends on how it works. If the chat connections go directly from the user’s browser to the external chat API, then it’s fine. Using an external live chat solution is usually what we recommend, and that’s basically what you’re building here. Assuming that Hostinger allows this as well.

If the chat connections go through a PHP script on our hosting that then loads the messages from the API, then that’s not allowed. Then the only thing that changes from our end is that you’re replacing a MySQL query with an external HTTP call, which is similar but worse to a direct live chat implementation.


Assuming your implementation is the former category and Hostinger allows it, it still seems like a very complicated setup for a suboptimal solution.

If you’re already paying Hostinger for a web hosting account, why still use free hosting for the rest of the project? You’re now adding another web hosting account that’s slightly different to what you already have, just for a single feature. Why not just get a web hosting account that supports the entire project?

Or instead of paying Hostinger to host a PHP chat script, you could also use an external Websockets solution. Something like Pusher can handle the websocket connections for you, and so your PHP code can push new messages to Pusher that sends them to the user via a websocket connection. That eliminates the polling completely. And Pusher has a free tier, so you could build it without having to pay anything.

And just stating it for the sake of completeness: you could use an off the shelf live chat solution and just integrate that, instead of building your own.

Our free hosting is for websites only, meaning CORS requests from other websites are blocked. But we don’t block access from websites on our hosting to other services (very messy to do and doesn’t really give us anything). But if the main site is hosted here and the chat API is elsewhere, that doesn’t apply to you.