Error running shell script in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jigarshah89
    New Member
    • Mar 2010
    • 1

    Error running shell script in php

    i have some problem to shell script using php...
    my script is file is a.sh:::
    Code:
    #!/bin/sh
    
    echo "ATZ0" > /dev/ttyACM0    
    echo "AT+CSCA?" > /dev/ttyACM0  
    echo "AT+CMGF=1" > /dev/ttyACM0  
    echo "AT+CNMI=2,1" > /dev/ttyACM0      
    echo "AT+CMGS=\"09924927267\"" > /dev/ttyACM0 
    echo "hello\32" > /dev/ttyACM0
    and my php file is index.php::
    Code:
    <?php
    exec("./a.sh");
    
    ?>
    i cant run this script...pls help me with this
    Last edited by numberwhun; Mar 13 '10, 03:24 PM. Reason: Please use CODE tags!
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    What do you mean "can't run this script"? What happens? What doesn't happen? What errors do you receive? Have you got error_reporting ($level) turned on?

    Comment

    • philipwayne
      New Member
      • Mar 2010
      • 50

      #3
      Umm your not echoing the output?

      Code:
      [b][u]echo[/u][/b] exec("./a.sh");

      Comment

      Working...