Hi,
w i l l wrote:
I am trying to execute a perl CGI from within a PHP script. I have
tried the following notation without success.
<?php include("http://" . $_SERVER['SERVER_NAME'] .
"/somedir/afile.cgi"); ?>
The CGI works on it's own without problems. Is this a limitation of
PHP?
include() brings in another PHP file rather than requesting another page.
Under Apache you can use virtual("/somedir/afile.cgi"); to execute a
subrequest.
If you're not using Apache, but have URL wrapper turned on, you can use:
$fd = fopen("http://" . $_SERVER['SERVER_NAME'] . "/somedir/afile.cgi",
"r");
fpassthru($fd);
Or as someone else has suggested, you could run it directly using the
system execution functions if the script is on the same machine.
Regards,
Luke