Hi, and welcome to the forum.
Did you install PHP on your computer?
If so, maybe you're saving your files in the wrong folder? I seem to remember, back when I was running PHP on my computer, that my files would only run if I saved them in the right directory. I was using Xampp (some thingy that comes with PHP, a web server, and other stuff) so it was c:\xampp\htdocs\xampp
I try to help people here but I'm not that good at it yet. If I have failed to be of any assistance, fear not, somebody much more experienced than me will reply