Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install phpmyadmin on centos vps hosting. I have uploaded all the phpmyadmin files in /usr/share/phpmyadmin as it was said in a tutorial but now when I enter I get 404 error message. Any ideas?

share|improve this question
up vote 2 down vote accepted

It is not enough just to upload files to /usr/share/phpmyadmin. There are several ways to install it:

  1. The easiest way is to install it via yum (I don't use centos since centos 5 is release, but I hope it is still via yum)

  2. Hard way is to install manually. Installation contains of several steps: 2.a. Dowanload and unpack files is /usr/share/phpmyadmin` (already done) 2.b. Add alias in your http daemon config. In case you're using apache, just put in your /etc/httpd/conf.d/phpmyadmin.conf something like that:

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
            AddType application/x-httpd-php .php

            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_admin_flag allow_url_fopen Off
            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/


# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    Require valid-user

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All

And restart apache.

In case you're using another httpd or there is front-end+back-end solution just watch in your daemons manuals.

Hope it helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.