2

I am kind of trying to transfer my website to an Amazon EC2 instance. I have set up everything and now when I open my website instead of seeing the website I just get to see the source code.

Is there anything I did wrong in the setup process ?

EEAA
  • 109,363
  • 18
  • 175
  • 245
the_critic
  • 205
  • 2
  • 11

2 Answers2

6

You can't run PHP code from S3 at all -- it's just a storage service and a web server, it doesn't include a PHP application server. As the other answer states, you can set up an instance in EC2 and run a web application there, but EC2 and S3 are two different services.

Mike Scott
  • 7,993
  • 31
  • 26
  • Thank you, I was not quite sure how these two services work together. Now I know they don't. Useful ! Thanks – the_critic Mar 16 '13 at 01:30
2

If you want to run php of Amazon EC2, you must have to follow this steps

Configuring PHP

First, the basics for PHP:

sudo yum install php-mysql php php-xml php-mcrypt php-mbstring php-cli mysql httpd

Press y for each of the prompts that shows up. Note that you’re logged in as ec2-user, so you need to sudo all of these commands.

You should now be able to create and run a PHP test file. Next, let’s get MySQL up and running.

Want more details read this article : Getting PHP and MySQL running on Amazon

  • very nice thanks very much ! I now have a web server running and installed php and mysql, but where do I upload my files, or more specifically, how do I do that ? I guess into the var/www/html folder, is that correct ? –  Mar 15 '13 at 09:18
  • great! yah you can upload it in var/www/html or create new folder inside ec2-user folder like public_html –  Mar 15 '13 at 09:24
  • you can upload it in any directory but make sure you must have to specify path in `httpd.conf` file –  Mar 15 '13 at 09:26
  • Brilliant thank you very much Sumit ! One more thing: If I wanted to add files to the folder via a ftp client how would I do that ? –  Mar 15 '13 at 09:30
  • you can't access you ftp but you can do it via sftp. –  Mar 15 '13 at 09:32
  • read this it will help - http://www.codestore.net/store.nsf/unid/BLOG-20111012-0812 –  Mar 15 '13 at 09:34
  • Host is your `Elastic IP address`, user name is `ec2-user` and no need of password last port no is `22` –  Mar 15 '13 at 09:36