Skip to content

Instantly share code, notes, and snippets.

@JonHilton
Created November 3, 2013 07:44
Show Gist options
  • Select an option

  • Save JonHilton/7287797 to your computer and use it in GitHub Desktop.

Select an option

Save JonHilton/7287797 to your computer and use it in GitHub Desktop.
I'm just not sure what I've done wrong here, Twilio *is* installed but I can't seem to point to the needed files
Errors from terminal
jon@ubuntu:~/Downloads/TextQnA$ php sendtest.php
PHP Warning: require( /path/to/twilio-php/Services/Twilio.php): failed to open stream: No such file or directory in /home/jon/Downloads/TextQnA/sendtest.php on line 3
PHP Fatal error: require(): Failed opening required ' /path/to/twilio-php/Services/Twilio.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/jon/Downloads/TextQnA/sendtest.php on line 3
jon@ubuntu:~/Downloads/TextQnA$ cd
jon@ubuntu:~$ pear install twilio/Services_Twilio
twilio/Services_Twilio is already installed and is the same as the released version 3.12.1
install failed
And now the code
<?php
require " /path/to/twilio-php/Services/Twilio.php";
// set your AccountSid and AuthToken from www.twilio.com/user/account
$AccountSid = "";
$AuthToken = "";
$client = new Services_Twilio($AccountSid, $AuthToken);
$sms = $client->account->sms_messages->create(
"+44-1254-", // From this number
"+44-7886-", // To this number
"Test message!"
);
// Display a confirmation message on the screen
echo "Sent message {$sms->sid}";
@caseysoftware
Copy link

Hmmm... maybe I can be of assistance.

"/path/to/twilio-php/Services/Twilio.php" isn't a literal path.. you're supposed to replace it with the actual path to your Services/Twilio.php file. Where did you download that library to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment