2

This seems like it should be easy to answer, but as a php newbie, I can't find out what exactly I need to install.

Some sites recommend just httpd, php and php-common; other suggestions include php-fpm and mod_fastcgi, as well as a bunch of php packages.

My goal is to be able to set up my dev machine and an amazon EC2 instance to be as similar as possible.

What do I need to install?

Marko
  • 227
  • 4
  • 7
  • 15
chris
  • 3,993
  • 6
  • 28
  • 37
  • This looks more like a question for StackOverflow than for ServerFault, because as far as I can see you're trying to learn PHP and not installing/using some PHP based software. Anyway, to make my comment more useful, installing the `php` package on Fedora should be enough for starting things up. – Cristian Ciupitu Oct 12 '12 at 19:55
  • @CristianCiupitu No, this is about AWS instances and how to deploy them with a set of software reproducibly. – Alexander Janssen Oct 12 '12 at 21:55
  • @AlexanderJanssen - I guess the question isn't as clear as it should be, but what I'm looking for is details on the required stack for hosting php - web server, plugins, and the php runtime. – chris Oct 13 '12 at 01:46

2 Answers2

2

On Fedora 17 it's sufficient to install the php package. This pulls in all necessary dependencies, including Apache.

On previous versions of Fedora, and current versions of RHEL, you need to install mod_php.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • I think the OP wants to know how to install the necessary packages via the `user-data` from AWS. To be honest, I invested an hour of research into it: I did this before with Ubuntu just to learn that it doesn't work like that with Fedora. They have their own funky way of dealing with user-data, and until now I didn't grok how the utilize /etc/cloud. The documentation is, midly said, crap. At this moment I'm talking to the Fedora-cloud people and I hope I'll be getting some insight... I'm really curious myself. – Alexander Janssen Oct 12 '12 at 20:52
2

Try AMI ami-2ea50247 from the Fedora Cloudimage site.

Then use as user-data in the AWS-console:

#!/bin/bash
yum -y install httpd php php-common php-fpm mod_fcgid

I just tried it because I was curious. Works like charm. Thanks to gholms from #fedora-cloud on Freenode for the hint about adding the hashbang.

If you need more machines, just "launch more like this".

You might want to add this to user-data:

chkconfig httpd on
service httpd start

To make it start automatically and right away after instance creation. Your pick.

Alexander Janssen
  • 2,607
  • 16
  • 21