I know in amazon's documentation it says S3 is not really made for server side scripting but to rather use EC2 instead. I don't need and will not use a operating system that EC2 provides to handle my server calls, it just seems pricey and seems to be an overkill. Basically, I have a couple php files that handle writing data to a RDS database and uploading videos to S3. Is it wrong for me to have my php files in S3 and allow static web hosting so that my iphone api can call the php scripts?Answer1:
<em>Static web hosting</em> means just that... no server-side script execution.
You cannot run PHP scripts on S3.<blockquote>
You can host a <strong>static website</strong> on Amazon S3. On a static website, individual web pages include static content. They may also contain client-side scripts. <strong>By contrast</strong>, a dynamic website relies on server-side processing, including server-side scripts such as PHP, JSP, or ASP.NET. Amazon S3 does not support server-side scripting.</blockquote>
<a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html" rel="nofollow">http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html</a>
Check out the EC2 <a href="http://aws.amazon.com/ec2/pricing/" rel="nofollow">free tier</a>.Answer2:
S3 has no way of actually executing your PHP files. It is just file storage that just happens to also be able to also serve up files in response to basic HTTP requests. But it can only serve up static content in this manner.
There is however nothing that says you need to use EC2 for your web application. You can use whatever you want for that, though you will likely see bandwidth cost penalties around S3 that you may be able to avoid using EC2.