Answer the question
In order to leave comments, you need to log in
How to run bash in php?
wrote a script for sending messages
<?php
$tel = $_REQUEST['rec'];
$text = $_REQUEST['text'];
$text2 = str_replace('"', ' ', $text);
$text3 = str_replace('\r\n', '###', $text2);
exec("/home/admin/yowsup/yowsup- cli demos --yowsup --config config " .$tel.' "' .$text3. '"');
?>
but for some reason the script doesn't work.
Answer the question
In order to leave comments, you need to log in
Probably forgot to check the rights? php has permission to execute this command?
The answer should be given by the console in any case
Redirect the console response with an error tostdout
a stderr
file, add it after your line in the parameters to the end of the
current
redirecting-stderr-to-stdout
А почему строку для запуска сразу не собрать в переменную и не отдать её в качестве параметра exec()
$str = "/home/admin/yowsup/yowsup-cli demos --yowsup --config config " .$tel.' "' .$text3
exec($str)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question