There are lots of ways to run php, but the easiest is via a website hosting account. Make a folder, maybe name it “phpstuff” and then upload your HTML and PHP files into that folder. Then load “https://foo.com/phpstuff/index.php”.
There are ways to install PHP on Mac, Windows, and Linux, but I haven’t found an easier way.
If you have a favorite way post below!