This would require knowing what software you’re using for your webserver. If you’re using the cgi-bin version you simply use #!/path/to/php to the top of your php pages and they’ll be ran as cgi’s using the php parser. Really need to know your configuration details.