Creating a PHP?

Have you seen this tutorial?

It links to the smartapp code here SmartThings API Endpoint Example · GitHub

and the corresponding php code here SmartThings .php example authenticating and controlling SmartThings API endpoints · GitHub

It looks like you are using that php code from the link. Do you have it on a web server running php? If so, what happens when you bring up the page?

If it’s working, once you get through the authorization, you’ll need to bookmark the URL. It’s been a while since I set one up, but I know in some cases, it didn’t automatically forward when going from one step to the next