要在 PHP 內呼叫 CGI script 可以用以下方法實現:

1.
<?php
$result = exec("testing.cgi < $myinput 2>&1");
print($result);
?>

2.
<?php
echo file_get_contents("http://yourdomain.com/cgi-bin/testing.cgi");
?>