You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"PHP Fatal error: Cannot redeclare Services_Twilio_autoload() (previously declared in /usr/share/nginx/html/2way/api/app/library/twilio-php/Services/Twilio.php:9) in /usr/share/nginx/html/2way/api/app/library/twilio-php/Services/Twilio.php on line 9"
The immediate cheap-and-dirty would be changing all your require and include to require_once and include_once
Don't include Twilio directly, but instead put it in the composer.json file and rely on the composer autoloader to provide the class whenever you need it.
Your first solution doesn't work, I tried that before posting this issue :)
But I am able to make it work now by making a single Twilio.php file that contain every class needed for SMS. This is maybe the dirtiest way but it works.
Hi everyone,
I use Phalcon PHP framework to make my web api. I use base project here https://github.com/jeteokeeffe/php-hmac-rest-api
Now I need to use Twilio for SMS.
I put twilio-php folder in library folder and then I included it in index.php
But I got this error
I checked this Twilio.php file and I tried to
var_dump(dirname(__FILE__) . "/Twilio.php"); die;
before this line
The return value is
Which is the same file (Twilio.php)
Is this why I got the "Cannot redeclare Services_Twilio_autoload()" error?
How to solve this?
Thank you very much
The text was updated successfully, but these errors were encountered: