So I spent the better part of last night (12-3:30am) trying to figure out just exactly how to get phpmyadmin installed on my Centos 5.2 Server. Now, I’m no dummy when it comes to linux, package management etc… But this was a task which apparently many other people have had trouble with. I finally gave up on it and went to bed, woke up this morning and went back to it… At which point I actually figured everything out and now have PHP 5.2.8 installed working with phpmyadmin 3.1.2 (which to day, all the most recent stuff) using mysql-server 5.1.31.
So here’s how I did it: Apparently the repositories that Centos 5.2 uses by default still have php 5.1.* so you can just do a yum update or yum install php. The first step here is to set up the Remi repository. He maintains a repository that has the most up to date version oh php and all of its extensions. You can set this up by doing the following:
$ wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm
$ wget http://rpms.famillecollet.com/el5.i386/remi-release-5-4.el5.remi.noarch.rpm
$ rpm -Uvh remi-release-5-4.el5.remi.noarch.rpm epel-release-5-2.noarch.rpm
This will set up the Remi repository for yum. By default it is disabled so you’ll have to use the –enablerepo option with yum when you are using it to install or update anything. So in order to update to php 5.2.* you just say:
$ yum –enablerepo=remi install php
To verify that you have php 5.2.8 installed issue a
$ php -v
And you’ll get a response like:
PHP 5.2.8 (cli) (built: Dec 9 2008 14:11:33)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
At this point I assume you already have mysql and mysql-server installed and configured. If not just issue:
$ yum –enablerepo=remi install mysql-server
It will install all of the necessary dependencies including mysql. Configuring mysql server using mysqladmin is actually out of the scope of this but there are plenty of tutorials online for that. Make sure you set up your and passwords for accessing it otherwise you’ll have issues later.
Now, you’ll want to install php-mysql. Again use the remi repository for this, otherwise you’ll end up with tons and tons of dependency issues. Trust me, I learned this the hard way…
$ yum –enablerepo=remi install php-mysql
This will install the mysql.so module for you and add it to php.ini so you don’t need to add the extension=mysql.so. It does the same for mysqli.
So now you’ve got everything you need set up properly, so install phpmyadmin. Get the tar ball from the server, extract it somewhere in your htdocs folder, create a system link called phpmyadmin. Go into the phpmyadmin and create a folder called config. Issue:
$ chmod o+rw config
Now because you’ve already set everything else up, you won’t receive the errors that I got on my first attempts. Now go to http:/www.yoursite.com/phpmyadmin/setup and follow the steps there. It’s a very nice little graphical interface that helps you set the configuration file. After this is done, move the config.inc.php file in the config directory to the head of the phpmyadmin directory. Then remove the permissions you set before:
$ chmod o-rw config
That’s it. Now you can go to http://www.yoursite.com/phpmyadmin and log in using your credentials for mysql-server.
Hope this saves everyone from running into all of the issues I had.
February 24, 2009 at 10:32 pm |
Worked like a charm and thanks I have been at it for a while and this saved me a ton of time. Awesome!
February 25, 2009 at 6:33 pm |
Having a difficult time with mcrypt extension. Did you have this problem?
February 25, 2009 at 6:37 pm |
I installed it using the remi repository as well. Have you attempted that yet?
February 25, 2009 at 6:57 pm |
Can not load mcrypt extension. Please check your PHP Configuration.
libmcrypt.i386 2.5.8-4.el5.centos installed
mcrypt.i386 2.6.8-1.el5 installed
php.i386 5.2.8-1.el5.remi installed
php-cli.i386 5.2.8-1.el5.remi installed
php-common.i386 5.2.8-1.el5.remi installed
php-devel.i386 5.2.8-1.el5.remi installed
php-gd.i386 5.2.8-1.el5.remi installed
php-imap.i386 5.2.8-1.el5.remi installed
php-ldap.i386 5.2.8-1.el5.remi installed
php-mbstring.i386 5.2.8-1.el5.remi installed
php-mysql.i386 5.2.8-1.el5.remi installed
php-odbc.i386 5.2.8-1.el5.remi installed
php-pdo.i386 5.2.8-1.el5.remi installed
php-pear.noarch 1:1.4.9-4.el5.1 installed
php-xml.i386 5.2.8-1.el5.remi installed
php-xmlrpc.i386 5.2.8-1.el5.remi installed
February 25, 2009 at 7:03 pm |
Have you checked your php.ini configuration to see that mcrypt is being loaded. Then restart httpd.
February 25, 2009 at 7:49 pm |
There is no entry in /etc/php.ini for mcrypt. Do you have the syntax in your php.ini file?
February 25, 2009 at 9:24 pm |
Just add the line:
extension=mcrypt.so
To your /etc/php.ini file and it should work fine. You may need to restart httpd.
February 27, 2009 at 3:18 am |
I do have the mcrypt problem..
after long search, I try to install this and it worked!!
[root@localhost etc]# yum –enablerepo=remi install php-mcrypt
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package php-mcrypt.i386 0:5.2.8-1.el5.remi set to be updated
–> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
php-mcrypt i386 5.2.8-1.el5.remi remi 29 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 29 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): php-mcrypt-5.2.8-1 100% |=========================| 29 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: php-mcrypt ######################### [1/1]
Installed: php-mcrypt.i386 0:5.2.8-1.el5.remi
Complete!
[root@localhost etc]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
anyone who got this probs, just do this and give your feedback here!
i solve this within 10 mins…
March 3, 2009 at 3:29 am |
Thanks that worked. I installed “mcrypt” instead of “php-mcrypt”;(.
yum list installed | grep mcrypt
libmcrypt.i386 2.5.8-4.el5.centos installed
mcrypt.i386 2.6.8-1.el5 installed
php-mcrypt.i386 5.2.9-1.el5.remi installed
yum list installed | grep php
php.i386 5.2.9-1.el5.remi installed
php-cli.i386 5.2.9-1.el5.remi installed
php-common.i386 5.2.9-1.el5.remi installed
php-devel.i386 5.2.9-1.el5.remi installed
php-gd.i386 5.2.9-1.el5.remi installed
php-imap.i386 5.2.9-1.el5.remi installed
php-ldap.i386 5.2.9-1.el5.remi installed
php-mbstring.i386 5.2.9-1.el5.remi installed
php-mcrypt.i386 5.2.9-1.el5.remi installed
php-mysql.i386 5.2.9-1.el5.remi installed
php-odbc.i386 5.2.9-1.el5.remi installed
php-pdo.i386 5.2.9-1.el5.remi installed
php-pear.noarch 1:1.4.9-4.el5.1 installed
php-xml.i386 5.2.9-1.el5.remi installed
php-xmlrpc.i386 5.2.9-1.el5.remi installed
March 5, 2009 at 8:11 pm |
[...] http://timt881.wordpress.com/2009/02/17/installing-phpmyadmin-and-php-52-on-a-centos-52-server/ [...]
March 24, 2009 at 5:50 pm |
Yea this doesn’t work for me.
I have the exact same problem, but I’m getting this output (php remains as 5.1.6 from 2006):
Transaction Check Error:
file /etc/my.cnf from install of mysql-libs-5.1.32-1.el5.remi conflicts with file from package mysql-5.0.45-7.el5
March 24, 2009 at 6:01 pm |
Remove all of your current php related packages including php itself, then use the steps listed above. You’re getting conflicts because of previously installed packages.
March 25, 2009 at 5:01 pm |
Yea that did it. Thanks alot.
March 25, 2009 at 5:30 pm |
except that removing the php packages will not clean it up. I have the same error. removed php and now I’m stuck in an odd state.
March 27, 2009 at 3:53 pm |
Wow I’ve found myself referring to this page a lot while setting up my new lamp server. Thanks so much for writing this.
April 2, 2009 at 6:31 pm |
Can you do the equivalent of –replacefiles in rpm with yum? Or do I have to uninstall the old el5 rpms?
April 3, 2009 at 4:11 pm |
you’ll have to uninstall the old el5 rpms.
April 9, 2009 at 2:56 pm |
This repository installs MySQL 5.1.32. I’m having a great deal of trouble transferring my stored routines from a production server running 5.0.67. I wonder if anyone has been able to successfully use stored procedures with this installation?
April 18, 2009 at 5:22 pm |
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rp
–14:19:10– http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rp
Resolving download.fedora.redhat.com… 209.132.176.221, 209.132.176.20, 209.132.176.220
Connecting to download.fedora.redhat.com|209.132.176.221|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
14:19:10 ERROR 404: Not Found.
… so much for Step One.
Is this a temporary problem I wonder?
April 18, 2009 at 5:27 pm |
Actually its not really a problem… You left off the ‘m’ at the end of the url. its a .rpm file. Fix that and you should be good.
For clarification the full url is…
http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm