Ubuntu 10: install PHP memcached with igbinary support

Because I needed the igbinary support for memcached, I couldn’t get the “pecl install” working for the PECL memcached module because it wouldn’t accept my compile flag (–enable-memcached-igbinary). My workaround is posted below.

  • Install memcached server
  • Install PHP igbinary extension
  • Install libmemcached library
  • Install PHP memcached extension

# first install memcached server using apt-get
$ apt-get install memcached
# make any changes to the config file, if necessary
$ vi /etc/memcached.conf
$ service memcached restart

Before installing the memcached extension for PHP, we need to install the igbinary package. Igbinary provides binary serialization for PHP objects and data which significantly speeds up the process.

$ pecl install igbinary

Now we need to make sure PHP loads the extension. To do that, open the file “/etc/php5/conf.d/igbinary.ini” and add the following:

[/etc/php5/conf.d/igbinary.ini]

extension=igbinary.so

Next step is to download a dependency called “libmemcached”, which is a C/C++ client library for the memcached server. It can be downloaded from http://libmemcached.org. At the moment of writing, the latest version is 1.0.2, which will be used in the following example.

$ wget http://launchpad.net/libmemcached/1.0/1.0.2/+download/libmemcached-1.0.2.tar.gz
$ tar xzvf libmemcached-1.0.2.tar.gz
$ cd libmemcached-1.0.2/
$ ./configure
$ make
$ make install

It’s time to install the actual memcached PECL extension. This will provide the Memcache class for your PHP code.

$ pecl download memcached
$ tar xzvf memcached-1.0.2.tgz
$ cd memcached-1.0.2/
$ phpize
$ ./configure –enable-memcached-igbinary
$ make
$ make install

What we did to load the igbinary extension, we’ll do it again for the memcached extension. Open the file “/etc/php5/conf.d/memcached.ini” and add:

[/etc/php5/conf.d/memcached.ini]

extension=memcached.so

Save and quit. Last thing to do is to restart the apache webserver, and check if the modules are loaded.

$ service apache2 restart

Memcached should now be loaded and should show up in phpinfo();. Please note that this way of enabling extensions might not work for everyone, depending on how your apache server is set up.

PHP Server Monitor 2.0.1 released

A minor update for PHP Server Monitor: version 2.0.1 has been released.
It incorporates several minor updates, some of which have been in CVS for a while now. Other issues include small features that have been requested in the tracker or by email.


The changelog of the new version:
- adding german language file (thanks to Brunbaur Herbert)
- adding french language file (thanks to David Ribeiro)
- servers page: auto refresh can be configured at the config page
- servers page: if the server is a website, the “Domain/Ip” field will be a link to the website
- new text message gateway: Clickatell.com (thanks to Simon)
- if cURL is not installed, the install.php script will throw an error
- HTTP status codes 5xx will also be treated as error
- classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY


Updating is quite easy as no database changes have been made. You can download the archive, extract it and overwrite your existing files. If you have made changes to the code yourself, please view CVS to see what has changed. Part of the update is a bit of code clean up, so quite a few files have been changed.


More updates will follow soon. If you have any questions or feedback you’d like to share, please visit the tracker at http://phpservermon.sourceforge.net or send me an email at ipdope[at]users[dot]sourceforge[dot].com.


PHP Server Monitor can be downloaded from http://phpservermon.sourceforge.net


Regards,
Pep

How wetsuits work

A great article, I think.

http://www.ewetsuits.com/acatalog/How-Wetsuits-Work.html

Robot juggles two ping-pong balls

configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.

Are you trying to install the PHP imagick extension but keep getting this error?
Besides the imagick extension there are 2 packages you need: imagemagick and libmagick9-dev.

apt-get install imagemagick libmagick9-dev
pecl install imagick

Don’t forget to add “extension=imagick.so” to your php.ini file and you should be ready to go.