Install phpMyAdmin 4.3.10 on Fedora 21/20, CentOS/RHEL 6.6/5.11 - Comment Page: 2
This is guide, howto install phpMyAdmin 4.3.10 with Nginx or Apache on Fedora 21/20/19, CentOS 7/6.6/5.11 and Red Hat (RHEL) 7/6.6/5.11 servers. phpMyAdmin needs web server with PHP and MySQL database. This guide uses Apache web server with PHP 5.6 or Nginx web server with PHP 5.6 (PHP-FPM) and MySQL 5.6 database server or MariaDB 10/5.5 database server. You can also use your already installed versions of web server, PHP and MySQL.
If you want to install phpMyAdmin with Apache then use a - [Apache] sections and if you want install phpMyAdmin with Nginx then use b - [Nginx] sections.
1. Install Needed Web and Database Servers
[Apache]
1.1a Install the whole LAMP environment with...
It’s working now. The only problem I have to work out is that I forgot the user/pass combination I had set up and Google-Fu isn’t helping. Lots of solutions, but nothing works yet.
But thank you again for the help on this. It was a bit of a pain, and I’ll be upping the memory ASAP on the server so it’ll work a bit better.
Hi antiwesley,
You are welcome! Excellent to hear that you got it working.
Check MySQL own guide, howto reset the root password.
yum –enablerepo=remi install phpmyadmin will fetch v 2.11 from rpmforg which is realy old insted type:
yum –enablerepo=remi install phpMyAdmin
which install 3.5.2.2 from epel
Hi pouya,
Yes, this depends what repositories you have installed, but if you want install it from remi repository, then you need to disable other not needed repos and install it from remi repo.
hi JR
In both statements we declare remi as our repo. i’m confused why we shouldn’t type
yum –enablerepo=epel install phpMyAdmin
if it’s possible please elaborate more
thanks i bookmarked your site and always check it for useful and uptodate tutorials
remi repo only contains 2.11 not 3.5.2
Hi pouya,
I said that you have to disable epel & rpmforge and enable remi:
Could you also post output of following commands:
My output from remi repo is following:
So I see currently only phpMyAdmin 3.5.2.2 on remi repository.
I’ve install nginx, php, mysql and phpmyadmin following this site’s essays. I can access http://pma/ now, while http://localhost/phpmyadmin/ is denied (404). What should I check?
Hi Ctu,
Check following comment, to setup localhost/phpmyadmin work with Nginx.
JR As I was saying I’ back :). Sorry to bother you but I’m a linux noob.
Followed your instructions wit success.
My issue is that since this is a VPS I don’t have aces to localhost. therefore I must access phpmyadmin from web.
How Do I do that. I’ve tried putting local host /phpmyadmin in the virtual host config with no success.
Also tried putting it in default config without results.
Thanks !
Hi again Mosfet :)
This is exactly reason why I run this site, try to help other users, so feel free to ask. :D
First a couple of questions…so you are using nginx setup, right? Do you have some domain pointing to this server and you have control to subdomains?
At this moment I have 2 domains pointing to the server. In test both work fine.
But when I’m trying to access phpmyadmin all I get is an empty page.
Tried the /phpmyadmin method posted in the comments and changing the “pma” in examples with my actual domain expecting to load phpmysql when accessing domain.tld to get phpmyadmin.
Ok, then if possible create subdomain which point to your server too:
pma.domain.tld
Then create virtual host file, like:
Restart Nginx and try to access http://pma.domain.tld
Hi, in order to make this more easy I’ve registered a .tk tld.
I’ve created virtual host file for that domain and tested with a hello world php example. The test and domain is http://www.phpmyadmintestdomain.tk and as you can see the “hello world ” is working just fine.
After this :
– I’ve created and pointed the subdomain myadmin.phpmyadmintestdomain.tk to the VPS server.
– Made a virtual-host file ( /etc/nginx/sites-available/myadmin.phpmyadmintestdomain.tk ) and a link to thesame file in /etc/nginx/sites-enabled.
– restart nginx ( service nginx restart )
Without any results. Also you can access the domain and subdomain.
THANKS !
This is the content of /var/log/nginx/phpmyadmin/error.log
2012/10/27 02:15:50 [error] 22242#0: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx (MY IP), server : myadmin.phpmyadmintestdomain.tk, request: "GET / HTTP/1.1", upstream: "fastcgi ://127.0.0.1:9000", host: "myadmin.phpmyadmintestdomain.tk"
2012/10/27 02:15:53 [error] 22242#0: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx (MY IP), server : myadmin.phpmyadmintestdomain.tk, request: "GET / HTTP/1.1", upstream: "fastcgi ://127.0.0.1:9000", host: "myadmin.phpmyadmintestdomain.tk"
2012/10/27 02:15:57 [error] 22242#0: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx (MY IP), server : myadmin.phpmyadmintestdomain.tk, request: "GET / HTTP/1.1", upstream: "fastcgi ://127.0.0.1:9000", host: "myadmin.phpmyadmintestdomain.tk"
2012/10/27 02:17:56 [error] 22242#0: *8 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx (MY IP), server : myadmin.phpmyadmintestdomain.tk, request: "GET / HTTP/1.1", upstream: "fastcgi ://127.0.0.1:9000", host: "myadmin.phpmyadmintestdomain.tk"
2012/10/27 02:18:09 [error] 22242#0: *8 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx (MY IP), server : myadmin.phpmyadmintestdomain.tk, request: "GET / HTTP/1.1", upstream: "fastcgi ://127.0.0.1:9000", host: "myadmin.phpmyadmintestdomain.tk"
2012/10/27 02:18:20 [error] 22269#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.xxx (MY IP), server : myadmin.phpmyadmintestdomain.tk, request: "GET / HTTP/1.1", upstream: "fastcgi ://127.0.0.1:9000", host: "myadmin.phpmyadmintestdomain.tk"
Right after submitting this message I’ve reloaded the subdomain and got this message
On further investigation I found that PHP-FPM crashes.
PHP-FPM error.log :
WARNING: [pool www] child 910 exited on signal 11 (SIGSEGV) after 1027.210867 seconds from start
Could you post your Nginx and PHP-FPM configs example to http://pastebin.com
Yup :D
nginx.conf : http://pastebin.com/XwXEFeJ3
php-fpm.conf : http://pastebin.com/dVWH92vR
Thanks again for your time and trouble.
Thanks Mosfet, could you also post your Nginx virtual host config and your PHP-FPM pool config?
Virtualhost: http://pastebin.com/FcWn0csJ
php-fpm pool conf : http://pastebin.com/hkkqrhNj
Hope I got the right files.
Thanks, looks right files…could you post output of following command here:
ls -la /var/lib/php
total 12
drwxr-xr-x 3 root root 4096 Oct 26 05:22 .
drwxr-xr-x 20 root root 4096 Oct 26 05:34 ..
drwxrwx— 2 root apache 4096 Oct 18 13:08 session
Okay, problem is your php session path permissions you run php-fpm as nginx:nginx (user:group) and it can’t access session storage, because it have root:apache permissions. You have two option to fix this.
1. Change following lines on php-fpm pool conf:
From
To:
Restart PHP-FPM.
2. Change /var/lib/php/session user and group to nginx
Or
Then try again access phpMyAdmin.
It works !
Thanks for all your help and time !
Excellent! :) You are welcome!
It finally works ! and by that I mean submitting messages to your blog (I’ve been trying for 3 days)
Really, did you got any error messages?
Works 4 me. CENTOS 6.3
Thank you !!!
Hi,
Great tutorial, but I am having a strange issue I can not find anywhere.
running CentOS 6.3
Apache 2.2.15
php 5.4.8
MySQL 5.5.28
when I go to http://mysite.com/phpmyadmin I get this on the screen.
phpMyAdmin –
I installed phpMyAdmin with Yum, following your tutorial.
When I put phpMyAdmin in one of my websites public_html directories it works fine. I would rather have it in the /usr/shared/phpMyAdmin directory though.
I installed SquirrelMail in the /usr/shared/squirrelmail directory, and it works as it is suppose to. I have tried a few different versions of phpMyAdmin and get the same thing.
Doing the command curl -I http://localhost/phpmyadmin from the ssh I get this.
[[email protected] ~]# curl -I http://localhost/phpmyadmin
HTTP/1.1 301 Moved Permanently
Date: Tue, 06 Nov 2012 14:18:31 GMT
Server: Apache/2.2.15
Location: http://localhost/phpmyadmin/
Connection: close
Content-Type: text/html; charset=iso-8859-1
[[email protected] ~]#
Any suggestions?
Thanks,
Hi Micahel,
What you get when you try:
Note trailing slash.
Hi,
Okay, this is what I get.
[[email protected] ~]# curl -I http://localhost/phpmyadmin/
HTTP/1.1 200 OK
Date: Wed, 07 Nov 2012 07:08:04 GMT
Server: Apache/2.2.15
X-Powered-By: PHP/5.4.8
Set-Cookie: phpMyAdmin=r4e2ha0okkfj38m3hrv0aruaiqhmq64s; path=/phpmyadmin/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Mon, 08 Oct 2012 15:21:21 GMT
Set-Cookie: pma_lang=en; expires=Fri, 07-Dec-2012 07:08:04 GMT; path=/phpmyadmin/; httponly
Set-Cookie: pma_collation_connection=utf8_general_ci; expires=Fri, 07-Dec-2012 07:08:04 GMT; path=/phpmyadmin/; httponly
Set-Cookie: pma_mcrypt_iv=VFpjxiI5%2FHM%3D; expires=Fri, 07-Dec-2012 07:08:04 GMT; path=/phpmyadmin/; httponly
Set-Cookie: phpMyAdmin=4rt305508u7kfvkrusubabpk0oar0k00; path=/phpmyadmin/; HttpOnly
Connection: close
Content-Type: text/html; charset=utf-8
Okay, looks like it’s working normally from localhost, so could you post output of following command:
Hi, thanks, here is my phpMyAdmin.conf file.
I can change it to allow all so you can see exactly what it is, or is not doing.
# phpMyAdmin – Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
# Apache 2.4
Require local
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from 72.8.251.26
Allow from ::1
# Apache 2.4
Require local
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
# These directories do not require access over HTTP – taken from the original
# phpMyAdmin upstream tarball
#
Order Deny,Allow
Deny from All
Allow from None
Order Deny,Allow
Deny from All
Allow from None
Order Deny,Allow
Deny from All
Allow from None
# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#
#
# SecRuleInheritance Off
#
#
Hi Michael,
Thanks! It should work if your external ip is that 72.8…and you have reloaded/restarted httpd after this change. Could you also check your httpd access and error logs, and check if you have something suspicious there?
Thanks for the help. I went to access it so it could be the most recent in the logs and it worked. No clue why it started working all of a sudden. I have not done anything to the server sense the last time I tried it and it did not work.
Thanks again.
You are very welcome!
Nice to hear that you got it working. Hard to say what the problem was, because your configuration is right, maybe it was due the browser cache…
This worked seamlessly. Had one issue with allowing external IP’s and it was answered in the comments. Much appreciated.
hi JR, questions like antiwesley, and I’ve tried to follow the steps in order to solve my problem. but my problem is not likely to INNO-db. is because when I look at the log (var / log / mysqld.log) there is no indication of a problem in the INNO-db.
and still not be able to access my phpmyadmin (Forbidden
You do not have permission to access / phpmyadmin / on this server.
Apache/2.2.3 (CentOS) Server at 192.xxx.xxx.xxx port 80)
you help me get this problem.
Hi Adji,
Could you try same on localhost, example using curl, and post output:
[[email protected] ~]# curl -I http://localhost/phpmyadmin
HTTP/1.1 301 Moved Permanently
Date: Thu, 13 Jun 2013 01:40:22 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://localhost/phpmyadmin/
Connection: close
Content-Type: text/html; charset=iso-8859-1
Oh my mistake, actually right command is same with slash:
But actually looks like, it’s running.
So then check /etc/httpd/conf.d/phpMyAdmin.conf and add following:
And then restart apache:
This using curl and post output :
[[email protected] ~]# curl -I http://localhost/phpmyadmin/
HTTP/1.1 403 Forbidden
Date: Fri, 14 Jun 2013 13:43:34 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1
And This is my /etc/httpd/conf.d/phpMyAdmin.conf :
# Apache 2.4
Require local
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
Allow from 192.168.1.67
I’ve followed the steps you give, but the problem still remains the same. “Forbidden
You do not have permission to access / phpmyadmin / on this server.
Apache/2.2.3 (CentOS) Server at 192.xxx.xxx.xxx Port 80 “
Could you also post output of following command:
I followed below mentioned steps but it failed due to dependencies. Please help.
Step 1: rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Step 2: rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Step 3: yum –enablerepo=remi,remi-test install phpmyadmin
Output of above is:
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for Red Hat kernel ABI
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package phpMyAdmin.noarch 0:3.5.8.1-1.el6 will be installed
–> Processing Dependency: php-mysql >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-mbstring >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-gd >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-php-gettext for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Running transaction check
—> Package php-php-gettext.noarch 0:1.0.11-3.el6 will be installed
–> Processing Dependency: php-mbstring for package: php-php-gettext-1.0.11-3.el6.noarch
—> Package phpMyAdmin.noarch 0:3.5.8.1-1.el6 will be installed
–> Processing Dependency: php-mysql >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-mbstring >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Processing Dependency: php-gd >= 5.2.0 for package: phpMyAdmin-3.5.8.1-1.el6.noarch
–> Finished Dependency Resolution
Error: Package: php-php-gettext-1.0.11-3.el6.noarch (epel)
Requires: php-mbstring
Error: Package: phpMyAdmin-3.5.8.1-1.el6.noarch (epel)
Requires: php-gd >= 5.2.0
Error: Package: phpMyAdmin-3.5.8.1-1.el6.noarch (epel)
Requires: php-mbstring >= 5.2.0
Error: Package: phpMyAdmin-3.5.8.1-1.el6.noarch (epel)
Requires: php-mysql >= 5.2.0
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest