How to setup virtual hosts on apache2 @ Ubuntu 14.04

Great article, works perfectly!

Next, to setup LAMP use another article from the same site

And then to set up phpMyAdmin:

gmagick php extension on windows

gmagick is a PECL extension which branched off from imagemagick in 2002. Some developers prefer it as it is supposedly faster.

As of this writing, there is only one set of available dlls for gmagick on windows. This works only with PHP 5.3 If you are using PHP 5.4 (available on the new version of XAMP) it won’t work.

One has to use PHP5.3. To get it working I had to use WAMPserver, find the right php.ini (using phpinfo) and then add the extension to it.

Specifically in your php.ini:

Some key concepts to understand:
– The Visual C (VC) Version used for the extension DLL and your PHP installation must match. Common version mismatches are VC6 and VC9.
– PECL for Linux allows for automated download and building of PECL extensions, this feature is not available in windows, thus requiring one to specifically install Visual Studio and do the installs (do-able, but painful if you are not a VC developer)
– PHP windows builds are available at If you must use an extension (most likely to get someone else’s code working) and you can’t find the extension for the most recent version of PHP, best to downgrade PHP (use previous version dlls)

Adding borders to inline grids (with 960Grid)

To add borders to elements using 960 Grid, create divs under the elements 960Gid and apply borders to them.

960Grid applies margins, borders, padding to all the elements it creates. So intentions of overriding these may not work out.

The comment here explains it in other words: Also for anyone stumbling here, be careful about something like “border:1px solid;” on the divs, they will increase the width of the div by +2 px and it will cause the same symptom described. You run into the same problem with padding. The solution for that is to add divs inside your grid_x divs, and apply the border or padding to those inner divs. – Purrell Jan 24 ’11 at 2:55

PHP relative include require incude_once require_once

The concept of relative is always from the file being executed.

ralph l mayo explains with an example here

Note that the relative starting point is always from the file being executed. Ie., if you have:


if index.php (the file the users requests) includes ‘../include.php’, include.php must include otherinclude as ‘otherinclude.php’ and not ‘myapp/otherinclude.php’

For this reason if you have includes spanning several directories or includes that are used in different contexts, it’s often easier to define a root path and include absolutely.

MySql troubleshooting System Error 5, System Error 1067

something went wrong with my MySQL instance. Looked up help online and tried starting mySQL through command line (with a hope to find out what was wrong)
Received: System Error 5 has occurred.

A little more searching revealed that I needed to run this in a Administrator Command window. To get that going do: start>run>cmd and then hit Ctrl+Shift+enter instead of the usual ‘enter’ only.

Next got 1067 when I tried net start

More googling revealed that mysqld –console would show the dump. Later realized that it is possible to get to the same error dump by visiting the data directory specified under my.ini config file. Anyways the Dump revealed:
C:\Windows\system32>mysqld –console
120623 13:02:55 [Note] Plugin ‘FEDERATED’ is disabled.
mysqld: Table ‘mysql.plugin’ doesn’t exist
120623 13:02:55 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgr
ade to create it.
120623 13:02:55 InnoDB: The InnoDB memory heap is disabled
120623 13:02:55 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120623 13:02:55 InnoDB: Compressed tables use zlib 1.2.3
120623 13:02:55 InnoDB: Initializing buffer pool, size = 42.0M
120623 13:02:55 InnoDB: Completed initialization of buffer pool
120623 13:02:55 InnoDB: Operating system error number 3 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: File name C:\Program Files\MySQL\MySQL Server 5.5\data\data2\ibdata1
InnoDB: File operation call: ‘create’.
InnoDB: Cannot continue operation.

The issue was because of InnoDB, something I did not plan to use. MyISAM Engine works out better for my purpose. So my next steps were.

Use the MySQLInstanceConfig at C:\Program Files\MySQL\MySQL Server 5.5\bin to remove the instance.

Next modify the my.ini file to mark MyISAM as the default instead of InnoDB:

Next I attempted to re-install the instance using:
mysqld –install –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.5\my.ini

I realized I had not uncommented the following line in my.ini:

Repeated: uninstalling the instance(mysqld –remove ), recreating the instance and running net start

NOW it WORKED. Good bye InnoDB and the issue.

References that helped:,837,5294#msg-5294

Installing memcache/memcached on windows and linux for PHP

Some great articles on how to quickly get one setup without needing to compile from scratch.

Windows setup. Only nuance I faced was around Msvcp71.dll/Msvcr71.dll which can be overcome using this method. Also has quick code to test out the setup.

Linux (CentOS/RHEL)

Also good to refresh the concepts and inspirations behind memcache(from its originator) and understand the difference between the two PECL libs