Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

php-sqs is a PHP class providing a simple interface to Amazon SQS.


Submitted By: heronblademaster
AWS Products Used: Amazon SQS
Language(s): PHP
License: New BSD
Source Control Access: public-read
Created On: March 11, 2009 9:26 PM GMT
Last Updated: March 15, 2009 3:02 AM GMT
php-sqs is a PHP class providing a simple interface to Amazon SQS. Visit the Sourceforge page for up-to-date information.


Tip for PHP users using PHP < 5.1.4
Simple and works. However it would be better to have the return values for all methods be the result from Amazon rather than true and false. All of the PHP libs available cater to PHP 5.1.*. Somehow I am stuck for quite some time with 5.0.4 and there is a problem. The latest signature 2 uses SHA256 that by default is not included with 5.0.4. To use signature 2 without SHA256 is possible - all you need to do is replace the following //$this->parameters['SignatureMethod'] = 'HmacSHA256';//HMAC-SHA1 $this->parameters['SignatureMethod'] = 'HmacSHA1'; and change the following method public static function __getSignature($string) { // hash_hmac with sha256 is not available in the older versions of PHP //$m =hash_hmac('sha256', $string, self::$__secretKey, true); $m = SQS::hmacsha1(self::$__secretKey,$string); return base64_encode($m); } public static function hmacsha1($key,$data) { $blocksize=64; $hashfunc='sha1'; if (strlen($key)>$blocksize) $key=pack('H*', $hashfunc($key)); $key=str_pad($key,$blocksize,chr(0x00)); $ipad=str_repeat(chr(0x36),$blocksize); $opad=str_repeat(chr(0x5c),$blocksize); $hmac = pack( 'H*',$hashfunc( ($key^$opad).pack( 'H*',$hashfunc( ($key^$ipad).$data ) ) ) ); return $hmac; }
phantomeye on April 10, 2009 2:28 AM GMT
We are temporarily not accepting new comments.
©2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.