Priti's Technical Corner

January 10, 2012

Install phpMyAdmin on CentOs 6

Filed under: Linux — Tags: , , — pritisolanki @ 11:23 am

Today I was trying to install phpMyAdmin on CentOs 6 and had  interesting walkthrough of the installation

1. Get the latest copy of phpMyAdmin from sourceforge

wget -c http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.4.9/phpMyAdmin-3.4.9-english.tar.gz  /download

2. Extract the files

tar xvfz phpMyAdmin-3.4.9-english.tar.gz

3. move the extracted files to proper location

mv phpMyAdmin-3.4.9-english.tar.gz /var/www/html/phpmyadmin

4. cd /var/www/html/phpmyadmin

5. Make a copy of configuration files

cp config.sample.inc.php config.inc.php

6. Modify the values vi config.inc.php

$cfg[‘Servers’][$i][‘auth_type’]=’cookie'; to $cfg[‘Servers’][$i][‘auth_type’]=’http';

7. Restart apache from any of command

service httpd restart – Work for me
/etc/init.d/httpd restart

8. Open browser on server

http://localhost/phpMyAdmin

You may end in following errors

1. 404 Not Found Error
Please make sure you push your phpMyAdmin directory in your webroot. In my case it’s /var/www/html

2. 403 Forbidden Error
I spend good amount of time finding why access is forbidden and finally did following setting

2.1 Go to /etc/httpd/conf.d/

2.2 vi phpMyAdmin.conf

2.3 Add following lines

<Directory /var/www/html/phpMyadmin>
Order allow,deny
Options Indexes
Allow from all
</Directory>

Still not able to access, try disabling the SElinux

SElinux is extra security layer in Linux and sometimes it provide conflicts for apache to work

  • vi /etc/selinux/config
  • Modify SELINUX=enforcing  to SELINUX=disabled  //Discuss with your senior. Mine is test server.
  • Restart your machine

hit http://localhost/phpMyAdmin prompt for username/password for mysql login :)

Please note all the steps executed via root credentials . You can use su command to login as root and carry the same steps.

I would like readers to drop the reviews comments to improve this article.

About these ads

14 Comments »

  1. i need an php drupal developer on a project , please help

    Comment by jeff dawson — February 6, 2012 @ 3:07 pm

  2. 2.3 Add following lines

    Order allow, deny
    Options Indexes
    Allow from all

    Order allow, deny creates an error when you restart apache. It only takes on argument.

    Comment by Alex — February 15, 2012 @ 4:29 pm

  3. remove the space between allow,_deny to allow,deny

    Comment by starter — February 25, 2012 @ 3:29 am

  4. hi, i followed your guide. but when i try to open the localhost/phpMyAdmin page i have the directory tree and not the welcome page…. also if i go to page localhost/phpMyAdmin/index.php i got a page with php and html code.. the code of index.php..
    do you have any suggestion for me? i miss any package?
    thank you very much

    Comment by Irene Bonta' (@sharkbait10) — April 19, 2012 @ 4:38 pm

  5. @sharkbait10
    Can you please check upon if php is correctly installed with Apache support. this link may help you http://www.lamphowto.com/. Please let me know in case you still struggle.

    Comment by pritisolanki — April 21, 2012 @ 1:49 pm

  6. Thanks for this. excellent article.

    Comment by Janey Lee — April 28, 2012 @ 4:55 am

  7. Awesome, works like champ.

    Thanks alot

    Comment by Tan — May 15, 2012 @ 12:02 pm

  8. very good article

    Comment by shridhara — August 16, 2012 @ 6:33 am

  9. thanks for this great article… really appreciate!

    Comment by Deepak — August 30, 2012 @ 6:15 pm

  10. Good job

    Comment by Deepak — October 1, 2012 @ 6:51 am

  11. article was very ………good

    Comment by jayaprakash — October 30, 2012 @ 6:33 am

  12. ‘yum install phpMyAdmin’ is another way to do

    Comment by Priti — December 7, 2012 @ 4:56 pm

  13. I have followed all the steps but still getting the 403 forbidden page anyone suggest something else than all the above steps

    Comment by AdamSaad — January 29, 2013 @ 5:38 pm

  14. very good instructions! Thanks very much!

    Comment by kenneth — March 6, 2013 @ 7:57 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 28 other followers

%d bloggers like this: