0

I'm having a very difficult time setting up a PHP4 LAMP stack on an EC2 instance. Does anyone know of any pre-configured AMI which supports PHP4?

For the record, I do not have the option to develop in PHP5

rocketas
  • 1,679
  • 3
  • 18
  • 30
  • 1
    You might be able to find one, but you'd be better off putting energy into migrating away from PHP4, which is now [five years past the end-of-life announcement](http://developers.slashdot.org/story/07/07/14/0646216/php-4-end-of-life-announcement). – willglynn Nov 07 '12 at 18:07
  • Powers that be compel me to use PHP4 – rocketas Nov 07 '12 at 18:41
  • 1
    Personally, I would show the powers that be [this list of PHP 4 vulnerabilities](http://www.cvedetails.com/vulnerability-list/vendor_id-74/product_id-128/version_id-66891/PHP-PHP-4.4.9.html), and then I would refuse to install PHP 4. Dealing with unsupported software is just not worth it for me. YMMV, in which case... good luck! – willglynn Nov 07 '12 at 19:17
  • Ha! That's pretty nuts. figures, I guess – rocketas Nov 07 '12 at 20:01

1 Answers1

2

Getting a php LAMP stack running on EC2 is rather painless, and you don't need a custom AMI. Using a standard Amazon Linux instance, log in as ec2-user and run these commands:

sudo yum update -y
sudo yum install -y mysql-server mysql-client mysql-libs mysql-devel
sudo yum install -y httpd php

Amazon does a good job of curating the packages in their yum repository, which is auto-configured with Amazon Linux. If you want to upgrade to php 5.4.8 simply execute this command instead:

sudo yum install -y php54

EDIT: Sorry, the php package is actually version 5.3.8, so if you really want to install php4, your best bet is to build it from source. It will likely be tough to support it ongoing. You'll likely need at least these standard packages installed to build it:

sudo yum install -y gcc gcc-c++ make zlib zlib-devel
sudo yum install -y openssl openssl-devel readline readline-devel
sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel
platforms
  • 2,666
  • 1
  • 18
  • 23
  • Ive set up LAMP on EC2 with php5 in the past np, havent gotten php4 to work though, building from source and all. Perhaps I was missing some of the above packages. – rocketas Nov 08 '12 at 16:12
  • Probably a good idea - I've seen a lot of info warning people off of php4. Glad to try anyway. – platforms Nov 13 '12 at 19:59