[Ilugc] how to execute .sh file in php

  • From: roshan@xxxxxxxxx (Roshan George)
  • Date: Mon Feb 1 17:27:14 2010

On Mon, 2010-02-01 at 02:54 -0800, Kannan wrote:

This is the shell script file is

//sendsms.sh
echo "Welcome" | gnokii --sendsms 9944047439
ls

php script is

</php
$n=exec("sh sendsms.sh ");
?>

Is there any reason you don't have this in your php script?

        <?php
                $n = exec("echo 'Welcome' | gnokii --sendsms 684757563);
        ?>

You might have to specify the whole path for gnokii. You can follow that
up with an ls if you really want to know what's in that folder.

Other related posts: