Page 1 of 1

calling perl from php

Posted: Thu Feb 18, 2010 8:40 am
by mehaj
hi,
i'm trying to call a perl script from my php code without success.
my php code :

Code: Select all

 
<?php
        $tel = $_POST['Tel'] ;
        $message = $_POST['message'] ;
        //$tel = 'xxxxxxx';
        //$message = 'viwwwww';
        print $tel;
        print $message;
        $outpout = exec("perl /var/www/htdocs/msg.pl $tel $message");
        print ($outpout);
    
?>
however,when i enter the following command in the command prompt it works

Code: Select all

php  /var/www/htdocs/sendsms.php
can someone help me please !!
thank's in advance

Re: calling perl from php

Posted: Thu Feb 18, 2010 10:50 am
by JNettles
Can you execute other commands from PHP using exec? Might be a permissions issue.

Re: calling perl from php

Posted: Thu Feb 18, 2010 11:19 am
by AbraCadaver
You most likely need the full path to perl.