doutang3077 2015-03-25 22:13
浏览 32

我可以从共享托管环境安装/使用Amazon PHP SDK吗?

Im interested in learning to use Amazon S3 PHP SDK and see references to 'installing' it (as opposed to it just being a series of files that I just upload to my hosting account and use) and all the tutorials seem to indicate I have to have command line access to the server.

Im using dreamhost and have a shared hosting account and would like to know: How do I go about 'installing' the sdk if I dont have access to the command line for the dreamhost account?

Im fairly new to PHP specifically but have experience with other languages and general programming principals (as3, vbscript, javascript, .asp, etc.)

I've managed to hobble together the following using some PHP-based (non AWS PHP SDK) routines others have shared online... so I currently have the following working great:

  • upload capability that allows my authorized user to upload files to a bucket successfully (using DIRECT UPLOAD TO S3)

  • bucket listing capability (getting files in a bucket as JSON that I'll consume and display in UI (using aws-s3-bucket-listing)

... the LAST critical missing piece is the ability to DELETE a file from a bucket.

I cant find where anyone has examples of doing this WITHOUT using the AWS sdks and decided to revisit the idea of using what seems to be a very powerful and robust sdk. It may be that given my limited experience with PHP that its just out of my league, but thats never stopped me before I guess!

Thanks for any light anyone can shed that can get me going in the right direction.

  • 写回答

1条回答 默认 最新

  • dte29947 2015-03-25 23:59
    关注

    The PHP AWS SDK is a composer based project. This means the best way to install it is to use composer via a ssh connection. It's been over a decade since I used Dreamhost, but their shared accounts should have SSH access.

    If that's not an option, use the require string

    {
        "require": {
            "aws/aws-sdk-php": "2.*"
        }
    }
    

    to find the project on packagist.

    The packagist page will point to the project's GitHub repository. If you look at the GitHub releases, you'll see a number of downloads, including a zip download. This download appears to have its own aws-autoloader.php file, so require that and you should be off to the races.

    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭