I am stuck. I have been researching this many hours now. While I have found a way to execute a perl script from PHP using any number of functions (passthru,system,exec,virtual ...) I have not yet found a way to pass a variable from the PHP script to the Perl script. It has been recommended that I use passthru in the following manner ...
passthru(/home/test.cgi $var) ...
where $var is the variable being passed from PHP to perl. This, however, has not worked for me. It is not due to permissions on my files, it may be due to settings in php.ini ... I have no idea. Hopefully someone out there will have an idea.

humbly,

chris

    Firstly check system logs secondly are you even trying to get the perl arguments?

    This should print any arguments being sent to the script.

    #!/usr/bin/perl
    print "@ARGV\n";
    

      that is exactly what I wasn't trying to do ... get the perl arguments. And that worked.

      I found out that if I used the php script ...

      passthru(/home/test.cgi $var);

      and then the perl script (test.cgi)

      $var = $ARGV[0];

      print $var;

      I would get the result that I needed.

      thanks,

      chris

        Write a Reply...