phpMyAdmin is a browser-based utility for managing MySQL databases.

phpMyAdmin likes to have libmcrypt installed with your PHP:

yum -y install libmcrypt-devel

Then compile your PHP with mcrypt support by adding --with-mcrypt to it's configure options.

Webserver Configuration
Create a base directory for the your private, local site:

mkdir -p /var/websites/private/logs/
mkdir -p /var/websites/private/htdocs
chown nobody:nobody /var/websites/private/logs
chown nobody:nobody /var/websites/private/htdocs
  • Apache
    Edit /usr/local/apache2/conf/httpd.conf and add a non-standard port for it to listen on (maximum allowed is 65535):

    Listen 12345

    Edit /usr/local/apache2/conf/extra/httpd-vhosts.conf and add a virtual host directive:

    <VirtualHost _default_:12345>
      DocumentRoot /var/websites/private/htdocs

      <Directory /var/websites/private/htdocs>
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all

      ErrorLog /var/websites/private/logs/private-error_log
      CustomLog /var/websites/private/logs/private-access_log combined

  • Lighttpd
    Edit /server/lighttpd/root/sites/private.conf and add a virtual host directive:

    var.basedir = "/var/websites/private/"
    server.document-root = basedir + "htdocs/"
    accesslog.filename = basedir + "logs/access.log"

    Edit /service/lighttpd/root/lighttpd.conf and add the link to the virtual host file:

    $SERVER["socket"] == ":12345" {
      include "sites/private.conf" 

Download the source tarball:

cd /var/websites/private/htdocs
tar zxf phpMyAdmin-
rm phpMyAdmin-

Move the phpmyadmin source files into the base directory:

mv phpMyAdmin- phpmyadmin
chown -R nobody:nobody phpmyadmin

In order to use the config script, we'll need to set up a conf directory:

cd /var/websites/private/htdocs/phpmyadmin
mkdir config
chown nobody:nobody config
chmod o+rw config

Access the setup script at http://<myserver>:12345/phpmyadmin/setup For the typical local install of MySQL, the default options for a new server will work just fine. If you are want to add a MySQL Sandbox server, then configure it with the sandbox's Server port(eg. 5141), Server socket (eg. /tmp/mysql_sandbox5141.sock), and set the Connection type to socket.

Once the config file has been saved, move it to the proper location:

cd /var/websites/private/htdocs/phpmyadmin
mv config/ .
chmod o-rw

You should delete the config directory once you are done:

rm -rf config

Recent Updates

  • 3 months 3 weeks ago
  • 3 months 3 weeks ago
  • 3 months 3 weeks ago
    php 8.x
  • 3 months 3 weeks ago
  • 3 months 4 weeks ago
    Drop Centos 5/6 stuff