How can a .cgi script be integrated into a .php page?

To integrate a .cgi script into a .php page, you can use the PHP `exec()` function to execute the .cgi script and capture its output. You can then echo the output within your PHP page to display the results of the .cgi script.

$output = shell_exec('/path/to/cgi_script.cgi');
echo $output;