Tag: PHP

How To: Make phpMyAdmin Look Sexy In Under 10 Seconds

How To: Make phpMyAdmin Look Sexy In Under 10 Seconds

PMA8165 Theme

A clean, dark and minimal theme for phpMyAdmin 4.2.x

This theme was born simply out of my deepest needs – more precisely the need to not have to stare at the ugly default phpMyAdmin theme all day long (sorry, guy who made it). But seriously now, it had to come to this – in a multiple screen setup where Gnome looks awesome, terminal windows look awesome and Sublime Text tops everything, phpMyAdmin just didn’t belong.

I guess one could say PMA8165 was somewhat inspired from the Numix GTK3 theme which, in combination with a few more things, can make Gnome look lethal as detailed in one of my fascinating blog posts on How To: Make Linux Look Sexy In Only 3 Fast Steps.


Go to your phpmyadmin themes directory:

cd /usr/share/phpmyadmin/themes

Clone the repository from github:

sudo git clone https://git@github.com/mjohnson8165/pma8165-theme.git pma8165

Then just go to your phpmyadmin page and select the pma8165 theme.


Here are a couple of screenshots so you can get an idea of what you’ll be getting:

PMA8165 Home

PMA8165 Table View

That’s about it, but if you’re in doubt, feel particularly constipated or for any number of other reasons you have a bad feeling about this, you should head over to the repository page and read the disclaimer section – that should give you an idea of what this is and what it isn’t. Enjoy!

How to install LAMP manually in 60 seconds

How to install LAMP manually in 60 seconds

It usually takes me a few good minutes to get the LAMP stack (Linux Apache MySQL PHP) installed and many more to get it configured to fit my needs. Well, I’ve finally managed to get it all together into a little something that can be done in under a minute. Assuming you’re doing this on a reasonably fresh Linux installation, these following lines will get you through with no problems and you’ll be the proud user of Apache 2.4 + PHP 5.6 + MySQL 5.6 in no time:

First, install a mother-load of packages (basically Apache, PHP, MySQL, phpMyAdmin and MySQL Workbench):

sudo apt-get install apache2 mysql-server mysql-workbench php5 curl php5-curl mcrypt php5-mcrypt php5-imagick php5-gd php5-xdebug phpmyadmin

Then, a few useful Apache modules:

sudo a2enmod rewrite headers expires deflate

Yeah… we might get a nasty looking message every time we restart the apache server, something like this:

apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message.

To get rid of that, we have to define the ServerName and include it in our configuration file.


sudo nano /etc/apache2/httpd.conf

This file might be blank, but add the following line to it anyway:

ServerName localhost

Then add these references to the apache2.conf file


Include httpd.conf
Include /etc/phpmyadmin/apache.conf

Cool, now as a security measure, it would seem that in newer Apache releases, the default document root points to /var/www/html instead of directly to /var/www. We might as well rename that html to public_html and update some configs.


sudo nano /etc/apache2/sites-available/000-default.conf

And change the DocumentRoot to this:

DocumentRoot /var/www/public_html

Also, while we’re in here we should add a few lines to prevent mod_rewrite from having girl problems later in life:

<Directory />
    Options FollowSymLinks
    AllowOverride None
<Directory /var/www/public_html/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all

Also, there might be some trouble with PHP’s mcrypt extension, so let’s make sure it actually gets loaded:


sudo nano /etc/php5/apache2/php.ini

Go down to Dynamic Extensions and add this line if it doesn’t exist:


And… that should be it – restart the web server and go to http://localhost/ to test the installation:

sudo service apache2 restart

Also, just for the thrill, you can make a phpinfo.php file in /var/www/public_html with just this:

<?php phpinfo(); ?>

to review all the modules and extensions that have been miraculously installed on your system.

Also, a quick tip on the nano editor if you haven’t moved on to vim already. Tab size should be 4 spaces – that’s it – period. If there’s already a .nanorc file in your home directory, add this line to it or create if first otherwise (dooh~)

set tabsize 4