douren4075
2017-01-31 07:27
浏览 19
已采纳

aws php sdk - 函数在本地主机和控制台上运行,但在服务器上不在浏览器上运行

I'm having an issue where my php function works when I call it from the server's command line, but not on the web page. It also works on the web page when I have it hosted locally through WAMP.

Any ideas what might be the issue?

function getCFTemplateSummary($CFUrl){
//init client
$client = new CloudFormationClient(array(
    'profile' => 'default',
    'region' => 'us-east-1',
    'version' => '2010-05-15',
    'http' => [ 'verify' => false ]
    ));

    try {
    $result = $client->getTemplateSummary(['TemplateURL' => $CFUrl]);
    }catch(\Aws\CloudFormation\Exception\CloudFormationException $e){
        echo $e->getMessage();
    }catch(\Aws\Exception\AwsException $e){
        echo $e->getMessage();
    }

    echo "<pre>";
    print_r($result);
    echo "inside the function";
    echo "</pre>";
    return $result;

 }

I was able to trace down the issue to this by trial and error commenting ...but not sure how to proceed debugging as I don't see any error messages.

$result = $client->getTemplateSummary(['TemplateURL' => $CFUrl]);
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题