我现在真的很困惑..我制作了这个 php 脚本来发送带有 gammu 的短信并将它放在我的主目录中
<?php
mysql_connect("localhost","username","password") or die("failed");
mysql_select_db("database1") or die("Database Failed");
$not_send = mysql_query("SELECT * FROM outbox WHERE status=0");
while($sending = mysql_fetch_array($not_send)){
$msg_id = $sending['id'];
$text = "gammu --sendsms TEXT ".$sending['phoneNum']." -text ".$sending['content'];
$sms = shell_exec($text);
if(preg_match("/ok/im", $sms)){
mysql_query("DELETE FROM outbox WHERE id = '$msg_id'");
}
}
?>
我已经用 确认了$text
输出echo $text
,但是当我在终端中运行它时,php send_sms.php
它总是说出乎意料的 '('
谁能告诉我这里有什么问题?或者我不能在 /var/www/ 之外运行 php 脚本??请帮我..