Setting up Couchbase PHP-SDK with XAMPP on Windows

Getting up and running with PHP on Windows has always been quite easy due to
XAMPP. It provides everything needed
to get started quickly and build something using a default stack available
everywhere. A lot of people get (or got) started this way, including me. But now
that MySQL, PHP, and Apache are setup maybe it’s time to try something new. For
me it’s been a while since I ran a setup like this and so I thought it’s worth
documenting the process.

Getting all the pieces

First of all you’ll need:

  • XAMPP for all your PHP and
    Apache needs, so install at least PHP and Apache
  • Couchbase, remember that you can try
    out the Enterprise version for development for free.
  • Couchbase-PHP-SDK
    XAMPP uses thread safe PHP so make sure you download the correct version
    (either x86 or x64 Thread Safe) for your environment.

Getting everything installed

For Couchbase and XAMPP you basically follow the instructions on the screen to
get it up and running, and make sure you configure Couchbase as well at the end
by visiting the web interface. Now all there is left is
moving the PHP stuff into place, which is probably the most complicated part of
a really easy setup. The zip downloaded from the windows PECL
page
contains 2 dll files,
libcouchbase.dll and php_couchbase.dll which need to be moved in the right
place. First to make php find libcouchbase it’s needs to be present c:apachebinlibcouchbase.dll and to make sure you can also use
php from the command line also copy it to c:xamppphplibcouchbase.dll and
add the XAMPP PHP to your PATH by going to Control Panel -> System and Security
-> Advanced System Settings -> Environment
Variables and edit the PATH
variable by appending c:YOUR XAMPP DIRECTORYphp. And that’s it you are
now ready to use Couchbase in XAMPP, by adding the extension to php.ini, so just add

https://gist.github.com/sideshowcoder/df131b67c173066291c3.js

Try it out!

Create a new PHP file at c:YOUR XAMPP DIRECTORYhtdocscb-test.php containing

https://gist.github.com/sideshowcoder/047d7989ad77e2b955e1.js

and open it in your browser to make apache run
it
you should now see the result in your browser.

cb-test-result

you can also use the command line of course.

cb-test-cmd

The end!

OK so you are now ready to use Couchbase from PHP, and if you need any help and
are in London this week stop by the Couchbase Developer Day as part of Big Data
Week
,
or even if you don’t still you should still stop by.

EDIT

You should also checkout Trond Norbye’s Blog basically describing the same setup.

SSH into Windows

Sometimes it’s just nice to have a secure access to the Windows box at home. In my case, if possible, I try to use SSH all the way, especially since it allows tunneling as well as file access in an easy to use fashion. So just for a quick setup I currently am using freeSSHd on Windows. To be more secure I only allow authorization via a ssh key for my own specific user. This is done by copying the “key.pub” file to “C:Program Filesfreesshd” and rename it to the user using it, in my case it’s now “phil”. Now just change the settings to only allow specific users, and the authentication to require Publickey. Now everything just works like every other SSH server, and it’s possible to use this connection for tunneling, file access and in my case to tunnel my RDP connection.

SSH connection to Windows

Windows 7 Release Candidate on Acer Aspire One A110

Since I bought my Acer Aspire One, I never was really sure what OS to put on it, I tried Ubuntu, Kubuntu, Slackware, Windows XP but nothing seemed just right. Recently I downloaded Windows 7 RC and ran it in a VM on my Mac, and really liked it. Since it is supposed to run on Netbooks I gave it a spin today, and here are my thoughts:Build the Windows 7 Install USB Key using this Guide and it worked perfectly. All drivers work out of the Box, I got WLAN and Sound right from the first start, great improvement over the Beta, which was missing the WLAN drivers for the Acer. Since I’m running the SSD based Aspire one I was kind of worried that the 8GB might not be enough but there is actually about 700MB left after installing, and since I moved all my User Folders to an SD Card which is always plugged into my Aspire One thats actually not a problem at all.

One more nice thing, Areo works (after you turn it on) great! Actually the OS is snappier with Areo turned on than without.

So far I’m pretty happy going to explore the OS more soon, keep updating!