ADBlock is blocking some content on the site

ADBlock errore

AWS S3 PHP Fatal error: Class 'CFCredentials' not found

StackOverflow https://stackoverflow.com/questions/13215424


So, I think I'm doing everything correctly here...

I downloaded the newest AWS PHP SDK, then I copy the config-sample.inc.php to config.inc.php and fill out the keys, etc.

In my application, I require_once("../AWS/sdk.class.php") and I'm getting an error:

"PHP Fatal error: Class 'CFCredentials' not found in /Applications/MAMP/htdocs/AWS/config.inc.php on line 50"

I pass the sdk_compatibility_test.php test, so can someone help me figure out what the issue here is???

I can't figure out how sdk.class.php gets access to the CFCredentials class, since it never includes/requires "utilities/utilities.class.php", but I imagine the devs at Amazon have it linked up some how. I think I'm just missing something.


No correct solution


Install AWS with Composer Package Manager for PHP, it's a clear procedure and is normally working out of the box.

You will also get the benefit to install other PHP based Packages easily, too.

The problem that I ended up having was that another framework (in this case Yii) had an autoloader that was refusing to allow the AWS classloader to load. If you are running MAMP in 5.2 like I am, you will be unable to change the AWS classloader to autoload before whatever framework you have. The following godawful code solved my problem:

spl_autoload_unregister(array('YiiBase', 'autoload'));
spl_autoload_register(array('YiiBase', 'autoload'));

You will need to change the AWSSDK path to point to the sdk class correctly - in my case i just used the absolute path.

This would normally be supplanted by using the spl_autoload_unregister parameter to prepend the autoloader to the autoloader queue, but in php 5.2 this is unavailable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow