Last updated on January 9th, 2020 at 12:34 pm

After googling few hour finally i find solution to configure PHPMyAdmin in Linux ec2 instance. Now in this post i explain you how to setup PHPMyAdmin in ec2 instance in simple steps. Please read my last post if you don’t know how to setup instance on AWS.

Before we start i revise all the step in short which we use to configure PHP and MySQL. I just paste command from Amazon Tutorial Blog please follow this link to read all commands in details.

Step 1. Download putty and login to server and update all packages using this command

[ec2-user ~]$ sudo yum update -y

Step 2. Install PHP and MySql using yum

[ec2-user ~]$ sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd

Step 3. Start Apache

[ec2-user ~]$ sudo service httpd start
Starting httpd:                                            [  OK  ]

[ec2-user ~]$ sudo chkconfig httpd on

Step 4.  Verify that httpd is on by running the following command.

[ec2-user ~]$ chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off

Step 5. Now open browser and type your Ip and you see your default Apache web server page.

Step 6. Set file permissions

[ec2-user ~]$ sudo groupadd www
[ec2-user ~]$ sudo usermod -a -G www ec2-user
[ec2-user ~]$ exit // Logout and login back

Login back and verify the group

[ec2-user ~]$ groups
ec2-user wheel www

Change the group ownership var/www

[ec2-user ~]$ sudo chown -R root:www /var/www
[ec2-user ~]$ sudo chmod 2775 /var/www
[ec2-user ~]$ find /var/www -type d -exec sudo chmod 2775 {} +
[ec2-user ~]$ find /var/www -type f -exec sudo chmod 0664 {} +

Step 7. Start MySql Server and configure its setting

[ec2-user ~]$ sudo service mysqld start

Now set its password and other setting

[ec2-user ~]$ sudo mysql_secure_installation

That it now all basic configuration is done.

Now Configuring PHPMyAdmin 

1. Download PHPMyAdmin from its official site. https://www.phpmyadmin.net/downloads/.

2. After download connect to server with FTP client like filezilla and upload zip file to server at /var/www/html/.

3. Now extract file using command bellow

tar -jxf phpMyAdmin-4.4.12-english.tar.bz2 -C /var/www/html

4. Now rename the  folder to phpmyadmin

mv phpMyAdmin-4.4.12-english phpmyadmin

5. Now open the browser :  <YOUR_IP>/phpmyadmin/setup/index.php

You need to add verbose name on this. please note you have to make config folder inside phpmyadmin folder and make it web writable and you change permission oft the folder, and follow instruction. If you get mbstring error please enter this command

sudo yum install php56-mbstring

All Done now you need to remove the config folder one config file is created. Now go to this link:  <YOUR_IP>/phpmyadmin and login.