arturo322 Posted January 10, 2011 Share Posted January 10, 2011 Hi im Art, Im trying to make use of Shell_exec() function to execute gammu(smsgateway for linux<CLI>) to text a message using my php page. This is my actual code: <html> <form method="POST"> Message: <textarea name=Message></textarea> Number: <input type=Text name=Number> <Input type=Submit name=Send value=Send> </form> </html> <?php extract($_POST); if (isset($Send)){ $output = shell_exec("pwd"); echo $output."<br>"; $cmd="gammu --identify"; echo $cmd."<br>"; $output = shell_exec($cmd); echo $output; $cmd="echo '".$Message."'|gammu sendsms TEXT ".$Number; echo $cmd."<br>"; $output = shell_exec($cmd); echo $output; } ?> But this is the error: /opt/lampp/htdocs gammu --identify Error opening device, you don't have permissions. echo 'Hi There'|gammu sendsms TEXT +639270000000 Error opening device, you don't have permissions. PS: It works well if just issue the command echo 'Hi There'|gammu sendsms TEXT +639270000000 on my terminal but i dont know why it doesnt work for php, and another thing, i wasnt using any sudo commands on shell i just type the command directly, hope someone can help me out thanks Link to comment https://forums.phpfreaks.com/topic/223969-shell_exec-with-gammu/ Share on other sites More sharing options...
arturo322 Posted January 10, 2011 Author Share Posted January 10, 2011 or perhaps how i can make libssh work for lampp ubuntu10.10 Link to comment https://forums.phpfreaks.com/topic/223969-shell_exec-with-gammu/#findComment-1157417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.