Created
November 3, 2013 07:44
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?