在AWS上托管角色应用程序使用php

在AWS上托管角色应用程序使用php

问题描述:

I'm new to AWS. I created a DB and I am currently hosting the website right now. This is great!

The problem is that I don't know how to integrate my PHP files that I was using before the start of AWS.

My previous stack was: Angular, MyPHP, MySQL, Apache. Everything was running locally. So I was able to use the same IP for the database and to also run php files.

What I tried to do was upload the php files into the S3 bucket. This doesn't work. The website will only download the file and not execute.

So how would I implement the same fluid way of integrating PHP on AWS as I did on my local computer?

我是AWS的新手。 我创建了一个数据库,我现在正在托管该网站。 这很棒! p>

问题在于我不知道如何在AWS启动之前集成我正在使用的PHP文件。 p>

我之前的堆栈是:Angular,MyPHP,MySQL,Apache。 一切都在本地运行。 所以我能够为数据库使用相同的IP并运行php文件。 p>

我尝试做的是将php文件上传到S3存储桶。 这不起作用。 该网站只下载文件而不执行。 p>

那么我如何实现在AWS上集成PHP的流畅方式,就像我在本地计算机上一样? p> div>

If you want to do this on AWS you will need an EC2 instance to run your dynamic queries to the database. S3 will only host static files or programming which works on the client-side (JavaScript).

If it is a basic website, you might want to consider LightSail

My suggestions would be,

  1. use EC2 instead of using s3 for hosting the PHP website as you can have complete control over the server.
  2. For setting up EC2 with PHP please follow the steps in the following article. Setting up EC2(ubuntu instance) for php