Reputation: 10058
Ubuntu 14.04 I'm deploying a Twilio app using PHP library. This is the Twilio client using PHP https://www.twilio.com/docs/quickstart/php/client/hello-monkey
When I opened the web page, I configured and loaded PHP libraries.
<?php
require_once('/var/www/html/client/twilio-twilio-php-9b83e2f/Services/Twilio/Capability.php');
// put your Twilio API credentials here
$accountSid = 'ACXXXXXXX';
$authToken = '43YYYYYYY';
$capability = new Services_Twilio_Capability($accountSid, $authToken);
$capability->allowClientOutgoing('APZZZZZZ');
$token = $capability->generateToken();
?>
<!DOCTYPE html> ...
When I opened my web page I get:
allowClientOutgoing('APZZZZZZ'); $token = $capability->generateToken(300); ?>
Yes... as if Apache cannot process the PHP file and access the $capability method. I created a php file and run it php client.php and it executes properly. Seems to be that Apache can't access this PHP method. I set permission to Apache user for client_browser.html file as well.
In console log I get:
Uncaught Twilio.Exception: Wrong number of segmentsf @ twilio.min.js:123(anonymous function) @ twilio.min.js:127(anonymous function) @ twilio.min.js:123a._setupEventStream @ twilio.min.js:33a.register @ twilio.min.js:26a @ twilio.min.js:22p.setup @ twilio.min.js:37a.run @ twilio.min.js:1e.onload.e.onreadystatechange @ twilio.min.js:3
twilio.min.js:58 [WSTransport] Socket opened
twilio.min.js:58 [PStream] Setting token and publishing listen
twilio.min.js:58 [Device] Received error:
twilio.min.js:58 Object {message: "JWT token parsing failed", code: 31204}
In Apache access/error logs:
Fri Aug 14 21:43:13.604388 2015] [core:notice] [pid 11742] AH00094: Command line: '/usr/sbin/apache2'
[Fri Aug 14 21:46:28.550794 2015] [mpm_prefork:notice] [pid 11742] AH00169: caught SIGTERM, shutting down
[Fri Aug 14 21:46:29.601427 2015] [mpm_prefork:notice] [pid 11832] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations
[Fri Aug 14 21:46:29.601467 2015] [core:notice] [pid 11832] AH00094: Command line: '/usr/sbin/apache2'
Any idea?
Upvotes: 1
Views: 159