I did already have Xampp on my machine. I had PHP installed as well as one of my instructors told me that I had to have it that way, Xampp installs PHP in a subfolder of Xampp. So in fact I had 2 PHP programs installed not knowing any better.
While I was waiting, I decided to uninstall the standalone PHP program and see what happens. Running the same commands again the executions worked.
It was then apparent that the standalone PHP did not and could not link to the server in Xampp. The PHP that was installed with Xampp was originally being overriden by the standalone PHP now that the standalone is no longer there PHP runs ok. I may be wrong in my assumption but I cant think of another explanation.
I thank you for your time, and hope that what I found can be used in the future.