Page 1 of 1

Php and Perl please help

Posted: Thu Oct 09, 2008 12:30 pm
by nriv08
I have a php script that has the session id number and i want to send this variable to perl. I am having trouble sending it.

Php script:

<?php

set_time_limit(0);
session_start();
$session = session_id(); #TRYING TO SEND "$session" to Perl Script

$session . ' ' . $fileLine2;

shell_exec("second_one.pl" . " -s " . $session);

?>

Perl Script:

use Getopt::Std;

getopts("s:", \%option);
$session_num = '';

if ($option{s}){
$session_num = $option{s};
}

I don't know where i'm goin wrong.

Help please.

Re: Php and Perl please help

Posted: Fri Oct 10, 2008 12:18 pm
by andyhoneycutt
are you getting any errors? if so, please post them.

Re: Php and Perl please help

Posted: Fri Oct 10, 2008 4:29 pm
by VladSun
Try using absolute path to your Perl script in shell_exec.
Also, is your Perl script executable? 0755 and shebang line?

PS: In fact, if your Perl script is not reachable through your PATH env var, it won't get executed event if it was in the current directory...