0

I want to send message from web to phone using Gammu SMS gateway. I try it before on command prompt using this command:

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

and it works!

Then I try it on a PHP file using:

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

but it doesn't work. Anyone can solve my problem?

techraf
  • 64,883
  • 27
  • 193
  • 198
  • Problems might be also caused by lack of permissions on the modem (see https://wammu.eu/docs/manual/config/index.html#option-Device). But still figuring out whether program can be executed and what does it print out is good starting point. – Michal Čihař Sep 08 '16 at 07:21

1 Answers1

0
  1. Set your Environmment variables of path and trigger i.e, path=%path%;c:\gammu\bin\

  2. And in your php code :- exec('gammu --sendsms text 08512345677 -text "Hello World!" ');

If issue persist, check the error logs. And can be due to permission issue.

  1. Most likely the web server is running as different user and Gammu running under this user does not see your configuration file and/or does not have permissions to open the device. Ref: Error trying to send sms by php
Community
  • 1
  • 1
Senthil
  • 2,156
  • 1
  • 14
  • 19