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
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
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