小编mod*_*don的帖子

在Amazon EC2实例上安装php和apache

我试图在亚马逊ec2实例上安装PHP但是当我运行以下命令时:sudo yum -y install httpd php54-fpm php54-common

它给了我以下错误:

     Loaded plugins: priorities, security, update-motd, upgrade-helper
    Setting up Install Process
    Resolving Dependencies
   --> Running transaction check
   ---> Package httpd.x86_64 0:2.2.25-1.0.amzn1 will be installed
   --> Processing Dependency: httpd-tools = 2.2.25-1.0.amzn1 for package: httpd-2.2.25-     1.0.amzn1.x86_64
   --> Processing Dependency: apr-util-ldap for package: httpd-2.2.25-1.0.amzn1.x86_64
   ---> Package php54-common.x86_64 0:5.4.17-2.41.amzn1 will be installed
   ---> Package php54-fpm.x86_64 0:5.4.17-2.41.amzn1 will be installed
    --> Running transaction check
  enter code here ---> Package apr-util-ldap.x86_64 0:1.4.1-4.14.amzn1 will be installed
   ---> Package httpd-tools.x86_64 0:2.2.25-1.0.amzn1 …
Run Code Online (Sandbox Code Playgroud)

php apache installation amazon-ec2 httpd.conf

9
推荐指数
2
解决办法
1万
查看次数

从amazon s3 buckets子文件夹中获取文件

我试图从亚马逊S3桶子文件夹中获取所有文件,并使其可以在网页中下载.

我有一个叫做图像的桶.在那个桶里面我有一些其他的文件夹.现在我试图获取该子文件夹中的所有文件并在页面中显示它.S3铲斗:/ images/images/test1// images/test2// images/test1/1/images/test1/2/images/test1/1/item

我试过这样,但无法得到预期的结果.

// Target files full path : images/test1/1/item 

$bucketName = 'images';
$source = '/test1/1/item' 

$image = $this->s3->getBucket($bucketName);
foreach ($image as $key=>$data){
   $k = $data['name'];
   print_r($k); // now this gives me full list of everything inside the images bucket. 
}
Run Code Online (Sandbox Code Playgroud)

现在,如果我想从存储桶中获取对象,我可以使用getObject,我尝试这样做:

$result = $this->s3->getObject($image); // I am confused about this one
Run Code Online (Sandbox Code Playgroud)

任何建议将不胜感激.谢谢,

在使用Josue Ibarra的以下答案后,我得到了类似的东西

(

 [tableuploads/1/emaillists/15.10.2013-18.03.23-emailList.csv] => Array
     (
         [file_name] => 15.10.2013-18.03.23-emailList.csv
         [file_folder] => emaillists
         [file_size] => 64
         [created_on] => 2013-10-15 19:03:26
         [s3_link] => http://s3.amazonaws.com/webtools_sharing/emaillists/15.10.2013-       18.03.23-emailList.csv …
Run Code Online (Sandbox Code Playgroud)

php codeigniter amazon-s3 amazon-web-services

5
推荐指数
1
解决办法
1万
查看次数