Reputation:
I created a file called awslib.php
and put it in the application/libraries
folder. These are the contents of awslib.php:
<?php
class Awslib {
function Awslib()
{
require_once('sdk-1.5.6.2/sdk.class.php');
}
}
Also in the libraries folder is the PHP sdk as a folder named sdk-1.5.6.2
.
On my home controller I am loading the library and instantiating the s3 class:
$this->load->library('awslib');
$s3 = new AmazonS3();
When I load my homepage I get this error:
Fatal error: Class 'AmazonS3' not found in /var/www/application/controllers/home.php on line 23
Why isn't it working?
Note: the problem isn't with s3, I can get it to work fine when I store it outside codeigniter and load the demo files that come with the sdk.
Upvotes: 3
Views: 9398
Reputation: 1983
I'm assuming you're using the SDK for PHP directly. Most SDKs don't play nicely in CI unless wrapped up.
I highly recommend using the amazon-s3 library (or rather, the spark).
Upvotes: 4