How to apply a Magento patch on a Windows computer

Like many people around the world, I develop on a Windows computer, but all my servers run Linux. Other developers may scoff and scorn at this, but that’s not the point of this article.

Being on Windows, applying a Magento patch isn’t as straightforward as it is on a Linux box, so I’m going to guide you through the process.

The problem with trying to install a patch on a Windows computer is that it uses command line tools that aren’t available in windows, for example sed and patch.

By far the easiest way to do this is to install cygwin on your computer. If you head on over to the install cygwin page and download the setup file (x86 version or x64 depending on your OS).

Once you’ve started that up, go through a few screens and you’ll be presented with this:


This is the packages list, and this is where we need to explore a bit. You’ll want (at least) the packages enabled by default, plus (at least) the following:

  • Devel > patch
  • Base > sed

I would also recommend browsing through this list and installing any useful utilities, e.g. :

  • Archive > bzip2, lzip, …
  • Base > everything in this list…
  • Database > any database tools you need, e.g. mysql-test
  • Editors > vim
  • Interpreters > any interpreters you want, e.g. PHP, python, perl, ruby, etc
  • Math > gnuplot
  • Net > curl, GeoIP, rsync, whois
  • PHP/Python/Perl/Ruby > any tools you want for these languages
  • Shells > any alternative shells you want
  • Utils > diffutils, duff, rpm, time, wiggle

Once that’s all downloaded and installed (any dependencies are automatically installed as well) you can start the patching process.

Copy the patch file to the root of your Magento installation

Open up a cygwin terminal and cd to your Magento installation.

cd /cygdrive/c/webserver/htdocs/magento

Now, just run the patch file, and it should work flawlessly.


Voila! Patch applied

Leave a Reply