If you have an existing AMIMOTO AMI running PHP Version 5.6, this guide will help you upgrade.

For a full upgrade we recommend creating a new AMIMOTO AMI and migrating. That would ensure you are running the latest version of all software including PHP7.

Target AMI:


We firmly recommend creating a snapshot before starting to upgrade for fail safe.

Check out our document How to Create a Snapshot and Restore from it. If you want to automate creating a snapshot, you'll need some additional modifications. For more details, check our document: How to Automatically Create a Snapshot

Step 1. SSH access to the server

ssh -i path-to-key-file.pem ec2-user@IP-ADDRESS

Step 2. Remove php-* from yum

$ sudo su -

# yum remove php php-*

Step 3. Downgrade PHP to the version 5.6 with modifiing configuration files of AMIMOTO AMI

run the following command, one by one:

# yum update -y
# cd /opt/local/chef-repo/cookbooks/amimoto
# git pull origin 2016.01
# cd /opt/local
# echo '{"phpfpm":{"enabled": true, "version":"56"}}' > /tmp/php-fpm-56.json
# hash jq || yum install -y jq
# jq -s '.[1] * .[0]' /tmp/php-fpm-56.json /opt/local/amimoto.json > /tmp/amimoto.json
# mv -f /tmp/amimoto.json /opt/local/amimoto.json
# /opt/local/provision
# service monit stop; service nginx restart; service php-fpm restart; service monoit start

Then place phpinfo.php on your document root and access it.

Did this answer your question?