PHP Amazon S3 上的文件无法正常工作

PHP files on Amazon S3 Not Working

我确定是个新问题,但我是 S3 的新手,正在尝试在我的服务器上打开一个简单的 PHP 文件。然而它每次都提示保存文件而不是打开它。 S3 不能 运行 PHP 文件吗?

我认为 Amazon S3 是 storage 而不是 server

Amazon S3: Amazon Simple Storage Service (Amazon S3), provides developers and IT teams with secure, durable, highly-scalable object storage. Amazon S3 is easy to use, with a simple web service interface to store and retrieve any amount of data from anywhere on the web. With Amazon S3, you pay only for the storage you actually use. There is no minimum fee and no setup cost.

Link: https://aws.amazon.com/s3/

Amazon EC2: Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.

Link: https://aws.amazon.com/ec2/

您想从 EC2 获取实例并在其 linux 服务器上安装 php

AWS 有一个很好的教程可以做到这一点 here

基本上 AWS EC2 linux 服务器与任何其他 linux 服务器相同,除了 AWS 的许多功能,因此您可以按照其他教程了解如何在 Apache2 上安装 PHP服务器。

祝你好运!

编辑:但是,您可以托管 static 网站。静态网站是为所有用户显示相同内容的网站。基本信息网站就是一个例子。与static网站相反,dynamic网站是一个为不同用户展示不同内容的网站。 php script 的目的是创建一个动态网站,因此您必须寻找 AWS S3 以外的其他选项。所以 EC2 非常适合您。