How to Install PHPMyAdmin on CentOS LAMP Server
| |Install and setup PHPMYADMIN MySQL software on CentOS server running Apache (LAMP) – I keep figuring what’s the next tutorials should be until then I contacted by one of my readers asking me how to install PhpMyAdmin. So here it is the tutorial to guide you how to install PhpMyAdmin on a CentOS server running LAMP stack (Linux, Apache, MySQL, PHP). However I assume by following this tutorial you have already had a server with LAMP stack installed, configured and running properly. Otherwise simply follow my previous guide how to set it up or here for installing LAMP with PHP 5.5 and MySQL v5.5.32.
What you’ll need?
- This guide is done in a CentOS 6.4 x86_64 VPS (as always by DigitalOcean). Hence, you’ll need a CentOS server. However you can still follow the tutorial by adjusting some commands if you are using any other Linux Distros.
- I also assumed you knew already how to use Putty or Terminal to SSH-ing a server.
- I believe you knew –at least part of– most common Unix commands used to manage an unmanaged server.
How To Install PHPMYADMIN
Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.
Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root. You may also need to type this command to go to the root directory:
cd ~
Step 2 – Install PhpMyAdmin via yum using this command:
yum install phpmyadmin -y
pic:
p.s: Optional – You better firstly issue “yum update -y” and “yum upgrade -y” before running above command just to make sure yum is updated.
Step 3 – So the you’ve installed PhpMyAdmin but you may also firstly need to edit Apache configuration before using it. Edit phpmyadmin.conf file:
nano /etc/httpd/conf.d/phpmyadmin.conf
Step 4 – Its main content will look like this;
# Web application to manage MySQL # <Directory "/usr/share/phpmyadmin"> Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> Alias /phpmyadmin /usr/share/phpmyadmin Alias /phpMyAdmin /usr/share/phpmyadmin Alias /mysqladmin /usr/share/phpmyadmin
Now you’ll need to comment (add # symbol) starting from <Directory “/usr/share/phpmyadmin”> till the </Directory> line. This is aimed to change the Apache configuration so that phpMyAdmin allows connections not just from localhost. At the end it should look like this:
Now save (Control+O) then exit Nano editor (Control+X).
Step 5 – This step is optional, changing how the way you login to PhpMyAdmin from “cookie”-based authentication to “http”. Edit PhpMyAdmin configuration file (config.inc.php):
nano /usr/share/phpmyadmin/config.inc.php
then look for the line that says:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
now replace ‘cookie’ with ‘http’
$cfg['Servers'][$i]['auth_type'] = 'http';
screenshot:
Once done, save it then exit Nano editor.
Step 6 – Finally, restart Apache and MySQL:
service httpd restart
and
service mysqld restart
pic:
Access and Login PHPMYADMIN
You can access PhpMyAdmin in your browser via:
http://your.ip.address/phpmyadmin
or
http://yourdomain.tld/phpmyadmin
Your browser should directly prompt you to enter username and password. You can simply use root as username and enter its password. Remember, the password is the MySQL root password not your server root password. You can also use any other MySQL username and password if you have created one. Read top most common MySQL basic commands.
dependences issues !!! see below
[root@mobiside /]# yum install phpMyAdmin
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.ndchost.com
* epel: mirrors.solfo.com
* extras: mirror.tocici.com
* updates: mirror.tocici.com
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package phpMyAdmin.noarch 0:2.11.11.3-2.el5 will be installed
–> Processing Dependency: php-mysql >= 4.1.0 for package: phpMyAdmin-2.11.11.3-2.el5.noarch
–> Processing Dependency: php-mcrypt >= 4.1.0 for package: phpMyAdmin-2.11.11.3-2.el5.noarch
–> Processing Dependency: php-mbstring >= 4.1.0 for package: phpMyAdmin-2.11.11.3-2.el5.noarch
–> Processing Dependency: php-gd >= 4.1.0 for package: phpMyAdmin-2.11.11.3-2.el5.noarch
–> Running transaction check
—> Package php-gd.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-gd-5.3.3-23.el6_4.i686
–> Processing Dependency: libfreetype.so.6 for package: php-gd-5.3.3-23.el6_4.i686
–> Processing Dependency: libXpm.so.4 for package: php-gd-5.3.3-23.el6_4.i686
–> Processing Dependency: libX11.so.6 for package: php-gd-5.3.3-23.el6_4.i686
—> Package php-mbstring.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mbstring-5.3.3-23.el6_4.i686
—> Package php-mcrypt.i386 0:5.1.6-5.el5 will be installed
–> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.i386
–> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt-5.1.6-5.el5.i386
—> Package php-mysql.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mysql-5.3.3-23.el6_4.i686
–> Processing Dependency: php-pdo(x86-32) for package: php-mysql-5.3.3-23.el6_4.i686
–> Running transaction check
—> Package freetype.i686 0:2.3.11-14.el6_3.1 will be installed
—> Package libX11.i686 0:1.5.0-4.el6 will be installed
–> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.i686
–> Processing Dependency: libxcb.so.1 for package: libX11-1.5.0-4.el6.i686
—> Package libXpm.i686 0:3.5.10-2.el6 will be installed
—> Package libmcrypt.i386 0:2.5.7-5.el5 will be installed
—> Package php-gd.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-gd-5.3.3-23.el6_4.i686
—> Package php-mbstring.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mbstring-5.3.3-23.el6_4.i686
—> Package php-mcrypt.i386 0:5.1.6-5.el5 will be installed
–> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.i386
—> Package php-mysql.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mysql-5.3.3-23.el6_4.i686
—> Package php-pdo.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-pdo-5.3.3-23.el6_4.i686
–> Running transaction check
—> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
—> Package libxcb.i686 0:1.8.1-1.el6 will be installed
–> Processing Dependency: libXau.so.6 for package: libxcb-1.8.1-1.el6.i686
—> Package php-gd.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-gd-5.3.3-23.el6_4.i686
—> Package php-mbstring.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mbstring-5.3.3-23.el6_4.i686
—> Package php-mcrypt.i386 0:5.1.6-5.el5 will be installed
–> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.i386
—> Package php-mysql.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mysql-5.3.3-23.el6_4.i686
—> Package php-pdo.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-pdo-5.3.3-23.el6_4.i686
–> Running transaction check
—> Package libXau.i686 0:1.0.6-4.el6 will be installed
—> Package php-gd.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-gd-5.3.3-23.el6_4.i686
—> Package php-mbstring.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mbstring-5.3.3-23.el6_4.i686
—> Package php-mcrypt.i386 0:5.1.6-5.el5 will be installed
–> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.i386
—> Package php-mysql.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-mysql-5.3.3-23.el6_4.i686
—> Package php-pdo.i686 0:5.3.3-23.el6_4 will be installed
–> Processing Dependency: php-common(x86-32) = 5.3.3-23.el6_4 for package: php-pdo-5.3.3-23.el6_4.i686
–> Finished Dependency Resolution
Error: Package: php-gd-5.3.3-23.el6_4.i686 (updates)
Requires: php-common(x86-32) = 5.3.3-23.el6_4
Installed: php-common-5.5.3-1.el6.remi.i686 (@remi-test)
php-common(x86-32) = 5.5.3-1.el6.remi
Available: php-common-5.3.3-22.el6.i686 (base)
php-common(x86-32) = 5.3.3-22.el6
Available: php-common-5.3.3-23.el6_4.i686 (updates)
php-common(x86-32) = 5.3.3-23.el6_4
Error: Package: php-mbstring-5.3.3-23.el6_4.i686 (updates)
Requires: php-common(x86-32) = 5.3.3-23.el6_4
Installed: php-common-5.5.3-1.el6.remi.i686 (@remi-test)
php-common(x86-32) = 5.5.3-1.el6.remi
Available: php-common-5.3.3-22.el6.i686 (base)
php-common(x86-32) = 5.3.3-22.el6
Available: php-common-5.3.3-23.el6_4.i686 (updates)
php-common(x86-32) = 5.3.3-23.el6_4
Error: Package: php-pdo-5.3.3-23.el6_4.i686 (updates)
Requires: php-common(x86-32) = 5.3.3-23.el6_4
Installed: php-common-5.5.3-1.el6.remi.i686 (@remi-test)
php-common(x86-32) = 5.5.3-1.el6.remi
Available: php-common-5.3.3-22.el6.i686 (base)
php-common(x86-32) = 5.3.3-22.el6
Available: php-common-5.3.3-23.el6_4.i686 (updates)
php-common(x86-32) = 5.3.3-23.el6_4
Error: Package: php-mysql-5.3.3-23.el6_4.i686 (updates)
Requires: php-common(x86-32) = 5.3.3-23.el6_4
Installed: php-common-5.5.3-1.el6.remi.i686 (@remi-test)
php-common(x86-32) = 5.5.3-1.el6.remi
Available: php-common-5.3.3-22.el6.i686 (base)
php-common(x86-32) = 5.3.3-22.el6
Available: php-common-5.3.3-23.el6_4.i686 (updates)
php-common(x86-32) = 5.3.3-23.el6_4
Error: Package: php-mcrypt-5.1.6-5.el5.i386 (epel)
Requires: php-api = 20041225
Available: php-common-5.3.3-22.el6.i686 (base)
php-api = 20090626
Available: php-common-5.3.3-23.el6_4.i686 (updates)
php-api = 20090626
Installed: php-common-5.5.3-1.el6.remi.i686 (@remi-test)
Not found
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
[root@mobiside /]#
What to do?
I have the same issue, some help would be appriciated!
Hey Mom! Could you please write a tutorial ‘how to install phpmyadmin with CentOS 6 + LEMP’?
The link to the phpMyAdmin folder is case sensitive in the config file, if you have any issue make the following changes
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Alias /phpmyadmin /usr/share/phpMyAdmin
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /mysqladmin /usr/share/phpMyAdmin
Thanks for mention that.
m facing this problem after installation of phpmyadmin
Forbidden
You don’t have permission to access /phpmyadmin/ on this server.
can i use phpmyadmin to upload scripts to my vps and open it like websites
no. phpmyadmin is for database management only
As usual, your guide saved the day. It doesn’t matter how many guides I try – they never work. Yours – first time, every time. Thanks for the guides and keep up the good work.
Hi, I am having a problem like this, how can I fix it?
http://i.imgur.com/DuCJXy6.png
Thanks, could you describe how can I upgrade it to phpmyadmin 4.2.7?
followed instructions exactly and I am getting phpMyAdmin – Error
#2003 – The server is not responding
Hello servermom, i install and log into phpmyadmin successfully but its says “Cookies must be enabled past this point.” whats the possible problem ??