【问题标题】:How to intergrate Gammu SMS gateway with PHP如何将 Gammu SMS 网关与 PHP 集成
【发布时间】:2016-09-07 05:49:07
【问题描述】:

我想使用 Gammu SMS 网关从网络向手机发送消息。我之前在命令提示符下使用此命令尝试过:

gammu --sendsms text 08512345677 -text "Hello World!"

它有效!

然后我在 PHP 文件上尝试使用:

exec('c:\gammu\bin\gammu --sendsms text 08512345677 -text "Hello World!" ');

但它不起作用。谁能解决我的问题?

【问题讨论】:

标签: php gammu


【解决方案1】:
  1. 设置路径和触发器的环境变量,即 path=%path%;c:\gammu\bin\

  2. 在您的 php 代码中:- exec('gammu --sendsms text 08512345677 -text "Hello World!" ');

如果问题仍然存在,请检查错误日志。并且可能是由于权限问题。

  1. 很可能 Web 服务器正在以不同的用户身份运行,而在该用户下运行的 Gammu 看不到您的配置文件和/或没有打开设备的权限。参考:Error trying to send sms by php

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-24
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 2013-02-27
    • 1970-01-01
    相关资源
    最近更新 更多