amazon web services - PHP echo is not working when added AWS headers -


i working on project have server. server connect amazon-cognito identity id , token. here php code.

test.php:

include 'aws.phar';  //require 'vendor/autoload.php'; use aws\cognitoidentity\cognitoidentityclient; use aws\sts\stsclient; use aws\credentials\credentials; use aws\s3\s3client;  echo "ok";  $client = cognitoidentityclient::factory(array(   'version' => 'latest',   'profile' => 'project1',   'region'  => 'ap-northeast-1' ));  $result = $client->getopenidtokenfordeveloperidentity(array(   'identitypoolid' => 'xxxxxxxxxxxx',    'logins' => array(     'login.blupinch.app' => 'sandesh-004',   ),   'tokenduration' => 3600, ));  echo $token = $result['token']; //echo null; 

when opened browser , type url of server, see "ok" not value of $token. interestingly, see "ok" , $token value if command line:

php test.php  

why happening? why can't see value of $token?

update: when run "php test.php". can see echo of token.like this

ubuntu@ip-172-31-30-222:/var/www/html$ php test.php

   okeyjrawqioijhcc1ub3j0agvhc3qtmteilcj0exaioijkv1milcjhbgcioijsuzuxmij9.eyjzdwiioijhcc1ub3j0agvhc3qtmtoxmmjiztjjos0zmdzkltrmy2itogy4mi0yzmnlnjc3nme1njqilcjhdwqioijhcc1ub3j0agvhc3qtmtphodcxzme1zi0ym2eyltq4mgqtymfhni1ingvkmze0mzcyndqilcjhbxiiolsiyxv0agvudgljyxrlzcisimxvz2lulmjsdxbpbmnolmfwccisimxvz2lulmjsdxbpbmnolmfwcdphcc1ub3j0agvhc3qtmtphodcxzme1zi0ym2eyltq4mgqtymfhni1ingvkmze0mzcyndq6c2fuzgvzac0wmdqixswiaxnzijoiahr0chm6ly9jb2duaxrvlwlkzw50axr5lmftyxpvbmf3cy5jb20ilcjlehaioje0ntq2odczmzcsimlhdci6mtq1ndy4mzczn30.bstytw8bk27vuqhaelijc1kdncjpqhqxpqjr3--ekgoii1vq8rptguljm2xjnincxvjjmtlxag8zn-guhydzgcvk6bm9ts1y_bpfoflvkjru3rxemmy24goqeb1xi0no6nvyhjw6mpkoof2fgwmr79ml0j0pnepoq4hxg_hj6ygdrvrypfjdm7g7klxveteeyrjeddvnyuoeh1sqrn7rka9eea_5pq8sbgk5bxhf1ruhlf_6pi-ymiu52-llfzdba0lxgtwrikvzy-khsksblt_a5ek52pxqspjucbfovwgajvqpdbb7i-ls1ijlth0baltcxgk1qsq52kdkwqvr6g 

by using code

echo $token = $result['token']; 

you echoing boolean result of assigning value of $result['token'] $token. looks should referencing 'tokenduration'

you need this

$token = $result['tokenduration']; echo $token; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

java - No use of nillable="0" in SOAP Webservice -