I am trying to get twilio to work with my website to send SMS.
Here are the steps i took,
First i downloaded the latest repo and put the Twilio folder under /libraries
then i added
$config['composer_autoload'] = '/libraries/Twilio/autoload.php';
to config/config.php
Then in my controller ,
I have a function that is,
$number = 'xx';
$country = '1';
$to = '+'.$country.$number;
require(APPPATH . "/libraries/Twilio/autoload.php");
// Use the REST API Client to make requests to the Twilio REST API
// Your Account SID and Auth Token from twilio.com/console
$sid = "xx"; // Your Account SID from www.twilio.com/console
$token = "xx";
$client = new Twilio\Rest\Client($sid, $token);
// Use the client to do fun stuff like send text messages!
$client->messages->create(
// the number you'd like to send the message to
$to,
array(
// A Twilio phone number you purchased at twilio.com/console
'xxx' => 'ADD Your Free/purchased Number',
// the body of the text message you'd like to send
'body' => "Hey Emir! It's Works"
)
);
So my problem is, when i run the view, this is the error i get,
A PHP Error was encountered
Severity: Warning
Message: require(/var/www/xxx.com/public_html/application/libraries/Twilio/Twilio/Rest/Client.php): failed to open stream: No such file or directory
So for some reason, Twilio/autoload.php adds another /Twilio in the path and i can't figure it out.
Any help?