【发布时间】:2014-03-17 13:21:51
【问题描述】:
未能打开所需的“AWSSDKforPHP/aws.phar”
(include_path='.:/usr/share/pear:/usr/share/php:/home/ec2-user/pear/share/pear') 在第 3 行的 /var/www/html/index.php 中
当它通过浏览器时出现此错误,当我在命令行中运行 PHP index.php 时它工作正常
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '/home/ec2- user/pear/share/pear');
require 'AWSSDKforPHP/aws.phar';
use Aws\S3\S3Client;
// Use the high-level iterators (returns ALL of your objects).
$objects = $s3->getIterator('ListObjects', array('Bucket' => $bucket));
//echo "Keys retrieved!\n";
echo "<h1>List of Blogs </h1>";
foreach ($objects as $object) {
echo $object['Key'] . "\n";
}
?>
【问题讨论】:
标签: php