Skip to content

Instantly share code, notes, and snippets.

@thekoushik
Last active October 25, 2018 08:09
Show Gist options
  • Save thekoushik/ccd7286e82dfda079a390a26dd643b5f to your computer and use it in GitHub Desktop.
Save thekoushik/ccd7286e82dfda079a390a26dd643b5f to your computer and use it in GitHub Desktop.
AWS EC2 Instance PHP 5.6 and MySQL 5.6

PHP

centos

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum remove php-common
yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
/etc/init.d/httpd restart
php -v

ubuntu

add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml

MYSQL

centos

wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
yum install mysql-server
/etc/init.d/mysqld start
mysql_secure_installation
mysql -u root

ubuntu

add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
apt-get update
apt-get install mysql-server
mysql_secure_installation
mysql -u root

phpmyadmin

wget https://files.phpmyadmin.net/phpMyAdmin/4.8.2/phpMyAdmin-4.8.2-english.tar.gz
tar -xvzf phpMyAdmin-4.8.2-english.tar.gz
mv phpMyAdmin-4.8.2-english phpmyadmin

composer

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer

Add swap space to instance if memory allocation error occurs Reference

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1

To enable it by default after reboot, add this line to /etc/fstab:

/var/swap.1   swap    swap    defaults        0   0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment