Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 http://mysite.com/phpmyadmin I get 404 error message. Any ideas?

share|improve this question

1 Answer 1

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/
    </IfModule>

</Directory>

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

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

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

 
discard

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.