I'm trying to add data from a webhook (from a web cart) to a local Microsoft SQL Server. It seems like the best route for me is to use a PHP script to listen for new data (POST as json), parse it, then query to add to MSSQL.
I'm not familiar with security concerning the connection between the PHP script (which would sit on a shared-host website) and the local MSSQL database. I would just keep the PHP script running on the same localhost (have Apache running on Windows), but the URI for the webhook needs to be publicly accessible.
Alternately, I assume that I could just schedule a script from the localhost to check periodically for updates through the web carts API, though the webhooks seem to be more fool-proof for an amateur programmer like myself.
What steps can I take to ensure security when using a PHP on a remote, shared-host to connect to MSSQL on my local machine?
host the PHP script on your localhost
if you are able to hostMSSQL
locally ?localhost without web
. I meant to say you can make your local apache server online the same way you are making your MSSQL accessible to an online php script. If that's not the case then How are you accessing your localMSSQL
inphp script hosted on shared hosting server
.correct
, no security issues with that as you will not be publishing URL anywhere else..If needed block all incoming HTTP request except for that particular domain.