Development

I recently did a project using cURL for PHP to SFTP files to a remote server… problem was, when I went to put the code live, SFTP wasn’t enabled in cURL. Doh! This is how I fixed it… don’t actually know if this is the “right” method, but it was tested on several servers and seemed to work well.

  • Make sure SFTP is not enabled already –

curl –version

  • If curl does not support SFTP currently we’ll build it

sudo apt-get install build-essential debhelper libssh2-1-dev
sudo apt-get source libcurl3
sudo apt-get build-dep libcurl3

cd curl-7.22.0/debian

  •  Edit the rules file to enable libssh2 support –

nano rules

– find and replace “–without-libssh2” with “–with-libssh2”

  •  Build curl with ssh support –

cd ..

sudo dpkg-buildpackage

  •  This should not be needed, but if you receive an error about missing dependencies, install them with apt-get and try to build the package again

apt-get install autoconf automake1.9 libdb-dev libgcrypt11-dev libgnutls-dev libidn11-dev libkrb5-dev libldap2-dev libnss3-dev librtmp-dev libssl-dev libtool quilt

sudo dpkg-buildpackage

  •  Install the packages you’ve built

cd ..

sudo dpkg -i curl_7.22.0-3ubuntu4_amd64.deb
sudo dpkg -i libcurl3_7.22.0-3ubuntu4_amd64.deb
sudo dpkg -i libcurl3-gnutls_7.22.0-3ubuntu4_amd64.deb

  •  Cleanup the files you’ve created –

rm -fr curl*
rm -fr libcurl*

  •  Reload Apache so the new version of cURL you have compiled is picked up by PHP –

/etc/init.d/apache2 reload

And that should be it!

You can check it’s actually enabled in PHP easily enough:


<?php

var_dump(curl_version());

?>

I bought a Squeezebox (Wireless Network Music Player) years ago. It’s got a web interface where you can view your music collection, add tracks to a playlist, change the volume etc… and I wanted a quick way to access it from my browser which didn’t mean navigating away from the page I was viewing.

So, I thought I’d try and make my first Chrome extension while I was at it! Awesome documentation/help files from Google as usual, it seemed to go smoothly enough. The extension is perfect for what I wanted, but may be a bit basic for some people.

I’ve added it to the Chrome Web Store anyway, here’s the link if anyone’s interested: Mini Squeezebox Control

Couple of small screenshots below: