【发布时间】:2016-10-18 15:14:06
【问题描述】:
我正在尝试使用 PHP 从 AWS EC2 实例获取用户数据:
<?php
$instance_id = file_get_contents("http://instance-data/latest/meta-data/user-data");
?>
但是,我不断得到:
PHP Warning: file_get_contents(http://instance-data/latest/meta-data/user-data): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in ... while reading response header from upstream, client: ..., server: ..., request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:"...
为什么?
【问题讨论】:
标签: php amazon-web-services amazon-ec2