I seemed to have made it work. Not sure how it's connected but this is what I had to do:
I'm using VSC and for some reason its terminal wasn't able to recognize php
commands. The strange thing was that I was able to execute them via the regular command line but not the editor's terminal.
This prompted me to add the location of the php
executable to the PATH variable. This enabled the editor's terminal to now identify php
commands and it started working. Very odd indeed.
Just putting it out there if someone comes across this behavior.