33dots

Posts RSS Comments RSS

Installing phpMyAdmin in my Cent OS 5.3

I did this by yum, which i think is the easiest way.

[root@localhost ~]# yum install phpmyadmin

This will install it in /usr/share/phpmyadmin

Now, configure it by editing config.inc.php

[root@localhost html]# gedit /usr/share/phpmyadmin/config.inc.php 

add the blowfish secret,
$cfg['blowfish_secret'] = 'a8b7dafdferHJHJ^&U^45776TIUuiYc6d';

and i also changed to mysqli in,
$cfg['Servers'][$i]['extension'] = 'mysqli';

Now you could access the phpMyAdmin by,
http://127.0.0.1/phpmyadmin/

This is possible because an alias is created for apache to the directory where phpMyAdmin in installed [ie /usr/share/phpmyadmin]. This is done in the file,

[tony@localhost ~]$ gedit /etc/httpd/conf.d/phpmyadmin.conf

You will see a lines like,
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

————-

You could also install phpMyAdmin manually by downloading phpMyAdmin.
Make sure you download the version 2.xx and not 3.xx[requires PHP 5.2] as Cent OS 5.3 has only PHP 5.1 by default

Extract the tar.gz file to your desktop.

Copy it to /var/www/html/phpmyadmin as root,

[root@localhost ~]# mv /home/tony/Desktop/phpMyAdmin-3.2.1-all-languages /var/www/html/phpmyadmin

Give the appropriate permission for apache,
Set owner as apache

[root@localhost html]# chown apache -R /var/www/html/phpmyadmin/

Set the group owner as your user, this is good as you can edit the files easily,

[root@localhost html]# chgrp tony -R /var/www/html/phpmyadmin/

Now give group user the write permission

[root@localhost html]# chmod g+w -R /var/www/html/phpmyadmin/

Now, add the blowfish secret and mysqli extension as above,

Thats all.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • LinkedIn
  • StumbleUpon
  • TwitThis
  • E-mail this story to a friend!
  • Print this article!

12 responses so far

12 Responses to “Installing phpMyAdmin in my Cent OS 5.3”

  1. Reuelon Sep 22nd 2009 at 7:55 pm

    Excellent…Now I find the config file. Thanks a lot it was pretty helpful.

  2. tonyon Sep 22nd 2009 at 9:33 pm

    :) ..Nice to hear from you.

  3. Sadeshon Jan 30th 2010 at 2:05 am

    Thank you for the guideline Tony. I installed phpmyadmin 3.2.5 using the steps above. Now, I am getting a blank page when I goto http://localhost/phpMyAdmin

    No source code for the page. Your input is appreciated.

  4. adminon Jan 30th 2010 at 12:24 pm

    Hi Sadesh,
    PhpMyAdmin 3.2+ requires PHP 5.2 which is not available in CentOS 5.3 by default. This might be the reason. Try using phpmyadmin 2.11 . I have noted this in the post. [although i now see that in the code it is written wrongly].

    If you have PHP5.2 or later, Check if the files are present.
    Any difference if you try http://127.0.0.1/phpmyadmin/ ?

    tony

  5. Sadeshon Jan 31st 2010 at 8:15 pm

    Thank you admin for the fast reply. I have PHP 5.3.1 installed. The files of phpmyadmin are in /usr/share/ and i have also created the alias. Restarted httpd.

    I also tried 127.0.0.1/phpmyadmin…it is still a blank page

    but, the website is working fine, which is because of working php and mysql.

  6. Sadeshon Jan 31st 2010 at 8:19 pm

    Also, when i tried to do a database backup using webmin, get this following error;

    Database backup failed : mysqldump failed :

    mysqldump: Couldn’t execute ‘SHOW FUNCTION STATUS WHERE Db = ‘irhfr”: Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50077, now running 50142. Please use mysql_upgrade to fix this error. (1558)

    Scheduled backup for database left disabled.

    FYI, my university has automated backup of the server and the databases using also mysqldump. Are these related?

  7. sonicon Jan 31st 2010 at 9:58 pm

    Hey Sadesh,

    Looks like you might be having some syntax errors in your conf file. And because of that the php execution is going into a fatal error and not displaying anything at all.. why don’t you try checking the syntax of your conf files using php -l

    for eg. php -l /usr/share/phpmyadmin/config.inc.php

    The ideal way to tackle this would be to do a tail -f on the apache error logs and see what errors are getting printed, and then you’ll have a better idea. Do let us know if this helped.

    sonic

  8. Sadeshon Feb 1st 2010 at 7:30 pm

    Thank you Sonic for the reply. This is what I got after execution of the php -l command;

    *** No syntax errors detected in /usr/share/phpmyadmin/config.inc.php ****

    Regarding “The ideal way to tackle this would be to do a tail -f on the apache error logs and see what errors are getting printed, and then you’ll have a better idea.”

    How do I do this? thanks again.

    - Sadesh

  9. tonyon Feb 1st 2010 at 9:59 pm

    Hi Sadesh,
    You have to find your apache error log files, in Cent OS and similar distros its in
    /var/log/httpd/error_log

    Next, giving tail -f anyfilename will print out the latest entries in that text file real time.

    In short, you do a tail -f yourapacheerrorlog in a shell, and then try to access the phpmyadmin in browser, to see what errors are getting printed.

    Btw, why dont you also try to do a manual installation of phpMyAdmin (as said in the second part of the article) and see if it works.

  10. Sadeshon Feb 3rd 2010 at 3:10 am

    Thank you very much tony. I have no idea what I did except,

    mysqlcheck –check-upgrade –all-databases –auto-repair
    mysql_fix_privilege_tables

    shell> mysql_upgrade

    Now, my phpmyadmin and webmin mysql db backup are working just fine. Again, I see following errors in the log, when I did as u instructed me.

    [Tue Feb 02 16:37:08 2010] [error] [client 127.0.0.1] PHP Deprecated: Function eregi() is deprecated in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 146

    [Tue Feb 02 16:37:11 2010] [error] [client 127.0.0.1] PHP Deprecated: Function ereg_replace() is deprecated in /usr/share/phpmyadmin/libraries/check_user_privileges.lib.php on line 34, referer: http://localhost/phpMyAdmin/index.php?lang=en-iso-8859-1&convcharset=iso-8859-1&collation_connection=utf8_unicode_ci&token=c9487836fccbc97339ca147cec4d13a9

    Thanks a lot.

  11. adminon Feb 4th 2010 at 12:52 am

    Good that you got it working.

    Regarding the error message: A quick google search shows that PHP 5.3 no longer supports those functions. Your phpMyAdmin seems not fully compatible with 5.3 yet.
    Anyway, since things are working better don’t bother about it.. :)

    tony

  12. Sadeshon Feb 4th 2010 at 8:59 pm

    Cool…Thanks a lot for ur active and quick response.

Leave a Reply