How to install Composer in Windows

I wanted to install PHP Composer in Windows. And to begin, I already have a copy of XAMPP 1.8.1, I think if you have a different way to get your PHP that should not matter. I tested this to work for Windows 7 but it should work for all versions of Windows.

0. Download and install XAMPP

You can download XAMPP here. I got the 7zip version rather than the installer itself. The ZIP version is similar, just with a larger file size. I extract the xampp folder into my C: drive, i.e. to C:xampp. Then install it by opening the file C:xamppsetup_xampp.bat. That will set the paths in XAMPP’s configurations.

1. Setting up environment variables

Continue reading “How to install Composer in Windows”

How to install pg gem for PostgreSQL in Ubuntu

I am using PostgreSQL 8.4 in Ubuntu 10.10.

After install postgresql-8.4 with aptitude in Ubuntu, I couldn’t seem to get the pg gem (postgres) to install right. It has the following error:

[code lang=”bash”]$ gem install pg
Building native extensions. This could take a while…
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.

/home/kahwee/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb
checking for pg_config… no
checking for libpq-fe.h… no
Can’t find the ‘libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:

Gem files will remain installed in /home/kahwee/.rvm/gems/ruby-1.9.2-head/gems/pg-0.9.0 for inspection.
Results logged to /home/kahwee/.rvm/gems/ruby-1.9.2-head/gems/pg-0.9.0/ext/gem_make.out[/code]

I already have libpq5 installed but I realized what I needed in libpq-dev.

[code lang=”bash”]sudo apt-get install libpq-dev[/code]

After installing, run “gem install pg” again:

[code lang=”bash”]$ gem install pg
Building native extensions. This could take a while…
Successfully installed pg-0.9.0
1 gem installed
Installing ri documentation for pg-0.9.0…
Installing RDoc documentation for pg-0.9.0…[/code]

And success.

Oracle shuts down open source test servers

Oracle shuts down open source test servers that PostgreSQL uses to test their builds. PostgreSQL is competing with Oracle’s MySQL and Oracle Database.

Oracle shuts down open source test servers

Like most open source platforms, PostgreSQL relies on an army of distributed volunteers. It is volunteers that, for example, operate the PostgreSQL Build farm, a “distributed, automated build and verify system” built by enthusiast Andrew Dunstan.

Oracle has shut down servers Sun Microsystems was contributing to the build farm for open source database software, PostgreSQL, forcing enthusiasts to scramble to find new hosts to test updates to their software on the Solaris operating system.

“It’s a vital piece of the infrastructure for developing PostgreSQL,” Dunstan told iTnews. “Before it existed, if some change we made broke on some platform, it was often weeks or months before we found out about it. Now we know within hours.”

At the start of July, Oracle shut down its three PostgreSQL build farm servers without warning, leaving the PostgreSQL community rushing to find replacements.

Dunstan said he “suspects” Oracle does view PostgreSQL as a competitor. (Source: IT News)

I love to see Oracle post their financial results, they have made quite a bit of cost cutting moves since the acquisition. You can hardly blame them too; they’ve got shareholders to report to. After all, doing too much charity work on open source is partly why Sun Microsystems failed in the first place.

How to fix missing MSVCR71.dll problem in Windows

I am using Windows 7, and I’m lacking MSVCR71.dll which is Microsoft Visual C Runtime library when using sendmail, the PostgreSQL PHP connector and curl. The MSVCR71.dll is probably bundled with .NET Framework 1.1 or something, but I couldn’t get those to install successfuly.
The program can't start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this program.

The program can’t start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this program.


So how do I solve it:

  1. Download MSVCR71.dll from (It is free.)
  2. Unzip…
  3. Place MSVCR71.dll into C:WindowsSystem32 or C:WindowsSysWOW64 if you using a 64-bit Windows.

And sendmail now works for me already in Windows 7.

By the way, I only tested this in Windows 7 64-bit. I assumed it would work for other versions of Windows. I would appreciate it if you could feedback to me if it works on your version of Windows. 🙂


It is reported working for Windows 7 32-bit as well.

How to run XAMPP’s PHP CLI and CakePHP console

XAMPP is one of the easiest options to develop using PHP or PHP CLI. I use CakePHP for development and one of the features of CakePHP is to back the MVC. In this guide, we’ll see how to get started. This tutorial doesn’t teach you how to use CakePHP’s bake feature. This guide is specifically written for Windows Vista or Windows 7.

0. Objective

To run XAMPP’s PHP CLI, you first have to set up the environment variables for PHP CLI. Also introduce how to get started on CakePHP’s console.

1. Setting up environment variables

Continue reading “How to run XAMPP’s PHP CLI and CakePHP console”

How to backup and restore in PostgreSQL

I was fairly impressed with pgAdmin III when I first used it. It seems to be simple to use for anyone who can’t write their own SQL statements. I wasn’t too good and it and each time I execute a change in the database I have a feeling the world’s going to end. But one thing the pgAdmin III doesn’t do well is backup and restore.

Using pgAdmin III for PostgreSQL

(Using pgAdmin III for PostgreSQL. A screenshot.)

0. Objective

In the end it’s best to use the command prompt (or terminal) and in this really beginner tutorial, we’ll do a backup and restore using the command line.

1. Set PATH for PostgreSQL in Windows Vista

This guide assumes you install in ‘C:Program FilesPostgreSQL8.3’, the default installation directory. Continue reading “How to backup and restore in PostgreSQL”

How to install PEAR modules using XAMPP

This guide aims to go through installation of PEAR modules using XAMPP. The module to install is MDB2.

I use XAMPP Lite instead of the full XAMPP but I imagine it to be the similar. My platform is Windows Vista.

0. Objective

To install PEAR module, MDB2, using a XAMPP set up. Also install the MySQL, MySQLi and PostgreSQL drivers.

1. Setting up environment variables

Continue reading “How to install PEAR modules using XAMPP”

Reddit is now open-source

Reddit decides to go open source. Reddit is already using open source software – Debian, lighttpd, HAProxy, PostgreSQL, Slony-I, various python libraries, Psychopg, pylons, Solr, Tomcat, Ganglia, Mercurial, Git, gettext (translation), daemontools, and memcached. The only thing that isn’t open source is Reddit itself so they decide to open source it.

(Souce: Reddit)

Oh so that’s what the penguin is about.