Actually, wouldnt it be simpler to use your cgi scripts rather than interfacing with PHP?
If you really need to pass values from a PHP script to CGI, it may depend on the cgi language, or I suppose you can just pass the values by the GET or POST methods or something.