If you are using a web server that is not supported by PHP, or to execute PHP scripts in a command shell rather than on a web page, you should compile PHP as a CGI executable.
There are no prerequisites for this task.
PHP is successfully compiled as a CGI executable.