Webhooks: What Am I Doing Wrong? PHP

That doesn’t make sense.

Why is your PHP website not online 100% of the time?

Your web server is presumably always on (right? your webserver is always on right?). Your webserver has PHP installed. When your webserver is contacted by Twitch with the payload, it uses the installed PHP processor to run your php script through it. PHP is not a web server. I think that’s the core problem here.

Because HTTP is like:
You request the data
Then you recive it
And the HTTP is closed.
If you want to charge something
You need to refresh and open a new HTTP protocol connection

My website is but my “code is not always refreshing”

Correct! Your code is not always running, because php is also not always running. Your webserver is always running though. When your website receives information from a client (in this case Twitch), it “turns on” php, and php runs your code. When php finishes running your code, it “turns off”.

Really :frowning:?
So when a POST response is sent to my website, it turns on PHP and use the webhook?

Yes, that is a pretty simple way of looking at it, but basically ya. PHP does not always run, your webserver always runs. Your webserver turns on PHP to process a request using your PHP script, and then when the script finishes, PHP turns off.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.