Ubuntu 13.10 Update - Magento No Longer Works

After the new Ubuntu version was released (I use Kubuntu), I updated my work computer at home to the new version.

Unfortunately, my Magento shops no longer ran properly in the local environment. This is mainly due to two things...

  1. The json_encode and json_decode functions are no longer bundled with PHP. This is due to a licensing issue, which I do not want to go into any further here.

  2. Mcrypt was no longer loaded.

When a product is added to the cart, the following message appears:

Notice: Use of undefined constant MCRYPT_MODE_ECB - assumed 'MCRYPT_MODE_ECB'

A quick call to n98-magerun.phar sys:check then showed me this output:

  Check: PHP  


Required PHP Module simplexml found.
Required PHP Module mcrypt not found!
Required PHP Module hash found.
Required PHP Module gd found.
Required PHP Module dom found.
Required PHP Module iconv found.
Required PHP Module curl found.
Required PHP Module soap found.
Required PHP Module pdo found.
Required PHP Module pdo_mysql found.
Bytecode Cache apc found.

So at least I could establish here that mcrypt was no longer being loaded.

Here are the solutions to both problems:

JSON Functions

These can be installed afterward through an alternative PECL module.

pecl install jsonc

Ubuntu has since provided a package:

apt-get install php5-json

mcrypt Module

On Stackoverflow, I found a short guide that worked for me straight away.

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
sudo service apache2 restart

Note the new php5enmod and php5dismod* commands, which were introduced along the same lines as the commands already available for Apache. They make it convenient to enable and disable a PHP module (including for specific SAPIs).

I hope this short guide helped a little...