Shell script in php

i have some problem to shell script using php…
my script is file is


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::



i cant run this script…pls help me with this

See if this does anything:

$output = shell_exec('./');
echo "<pre>$output</pre>";


nothing is happening…

Try using your full path from root e.g. /home/user/www/ and CHMOD the shell script to 777.

exec(" /home/user/www/ ");

still its not working should i shift to another platform like jsp??

It looks liek you are trying to access a modem or serial port? If so, this should help you:


You might be able to write to /dev/ttyACM0 directly from PHP with proc_open().