calling perl from php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mehaj
Forum Newbie
Posts: 1
Joined: Thu Feb 18, 2010 8:33 am

calling perl from php

Post 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
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: calling perl from php

Post by JNettles »

Can you execute other commands from PHP using exec? Might be a permissions issue.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: calling perl from php

Post by AbraCadaver »

You most likely need the full path to perl.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply