tags:

views:

48

answers:

2

I have a function written in PHP and would like to call this inside a CGI script. Is there any direct way to do this?

I am not sure if its even possible. The CGI script will be inside cgi-bin directory and the PHP function will be outside this folder.

+2  A: 

I guess you could try to use Inline::Interp or PHP, however, I am not sure I see the point, given the overhead involved in invoking yet another interpreter in a CGI script.

Sinan Ünür
thanks, can you please provide me an example how to code php inside cgi? so that i can see if it works and confirm if this module is installed.
Jay
@Jay, No, I do not have the time or interest to work out an example beyond what is in the distributions for those modules.
Sinan Ünür
A: 

have you tried via Command Line like so:

open DATA, "/path/to/you/bin/php you_script.php |" or die "Whoops: $!";

RobertPitt