The problem was my development environment. There was a couple of problems:
- cURL for PHP needs to be installed (in Ubuntu: apt-get install php5-curl).
- json for PHP needs to be installed (in Ubuntu: apt-get install php5-json).
I needed to upgrade from Ubuntu 12.04 to Ubuntu 13.10 to correctly install json for PHP.
After installing curl and json it worked as expected.