Using php5-memcached to store sessions on distributed servers

This article is an extension of the previous article about storing sessions in Memcached with PHP. Using Memcached for sessions storage is generally a matter of speed (storing them in memory is faster than on disk) and of scalability (using a Memcached server allows you to have several web servers serving the same PHP application in a seamless way). In the previous article, we mentioned (3 years ago) that the php5-memcached extension did not seem to manage the storage of sessions quite well, or at least t

Using Chamilo juju charm to setup a dev environment on Digital Ocean

If you're in a hurry/on speed, know this:
  • this procedure is slightly more difficult (so longer) than installing the charm on Amazon
  • you can skip directly to "Installing Juju"
  • if you already have juju installed, you can skip to the last 2 lines of the "Installing juju" section
  • if you already have juju-docean installed and configured, you can skip directly to "Provisioning VMs"
  • otherwise, just continue reading, it's worth a few minutes...
This tutorial regroups a lot of advanced notions, so if you want to know more about one of the follo

gem install mysql2 on Debian Wheezy with MariaDB 10

Just in case you would be in this situation (and given the fact I couldn't find online information about it), if you are ever installing the mysql2 gem on a Debian Wheezy system with MariaDB 10 (I would guess a rather rare situation), you might get this error:
# gem install mysql2 -v=0.3.11
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
 ERROR: Failed to build gem native extension.

 /usr/bin/ruby1.9.1 extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()...

On PHP and cache slams and solutions

While reading about Doctrine's cache mechanism (which applies to other stuff than database queries, by the way), my eye was caught by a little message at the end (last section) about cache slams. I have used cache mechanisms extensively over the last few years, but (maybe luckily) never happened to witness a "cache slam". There's a link to a blog (by an unnamed author) that explains that. To make it short, you can have race conditions in APC (and

PHP's @ hurts performance

Did you know...? As a "take away" information taken from this post https://gist.github.com/nikic/6699370 (by famous PHP core developer @nikita_ppv), it appears like the @ sign in PHP (used to "hide" errors, as the "error-suppression operator" it is) also disables the "compiled variables" optimization (OpCode caching).