0

I have a huge problem with sendnotification.php

  • I am running a localhost.
  • I purchased two Twilio numbers, trying to send a message from one to the other
  • I downloaded the SDK manually, and extracted it into my directory folder

Here is the short code (with placeholders):

<?php
    require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
    use Twilio\Rest\Client;

    $AccountSid = "x";
    $AuthToken = "y";

    $client = new Client($AccountSid, $AuthToken);
    $sms = $client->account->messages->create("+11111111", "+222222222", "Hey");
?>

<!-- html ... -->

It shows only a blank white page. If I comment out the last $sms ... line, the html shows but no message is sent.

What is the problem?

Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
  • 3
    Check your server's error logs. A blank page in PHP **always** means a useful error message is floating around somewhere. – ceejayoz Apr 14 '17 at 17:24
  • 2
    You might want to delete the question instead of vandalizing it. Or, answer it if there's a chance the answer might be useful to someone. – John Dvorak Apr 14 '17 at 17:48
  • If you cannot read the logs for any reason, you can try to add error displaying at the top of your script. Like so: `ini_set('display_errors',1); error_reporting(E_ALL);` – Yolo Apr 18 '17 at 09:12

0 Answers0