I’m trying to create a signature request for amazon’s AWS api using PHP. I’m not too familiar with PHP so this question might seem extremely obvious, so for that I’m sorry –
Amazon provides sample code for generating the signature request to use their API – which can be found here:
http://aws.amazon.com/code/AWIS/402
Their instructions state simply:
Run php urlinfo.php ACCESS_KEY_ID SECRET_ACCESS_KEY site
But I’m not sure how to “run” a php file. My instinct was to include the php file so I could make a call to its public urlInfo function:
UrlInfo($accessKeyId, $secretAccessKey, $site)
but if I include it:
<?php require_once ('urlinfo.php'); ?>
The page automatically generates the message:
Usage: ACCESS_KEY_ID SECRET_ACCESS_KEY site
So how do I call this php file from my index file and pass it the parameters it requires?
The urlinfo.php script was intended to be ran via PHP command line interface and expects arguments passed on via cli.
If you remove the following portion of the code:
And then do:
It will work as expected.