tamak
tamak

Reputation: 1591

Can I install / use Amazon PHP SDK from a shared hosting environment?

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:

... 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.

Upvotes: 0

Views: 540

Answers (1)

Alana Storm
Alana Storm

Reputation: 166076

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.

Upvotes: 2

Related Questions