Skip to main content


Showing posts from November, 2011

How to fix Piwik not working when https protocol is enabled

If you noticed that your Piwik has stopped working when enabling SSL or it never worked in the first place using https, you may be having issues with the protocol. Most hosts only allow SSL for one subdomain (usually www) unless you order an expensive package so if you happened to install Piwik on a subdomain (say while SSL will work, an exception will need to be made as the certificate doesn't match the exact URL.  Because of this, piwik will not load the scripts correctly.  Luckily this is simple fix.

Make sure SSL is the problemUpdate the tracking script
Step 1:

To make sure that SSL is a problem you have to try to load the piwik.js file from your installation folder using both https and http.  By default, mine was trying to use https and it was showing something similar below in firebug. If it shows the piwik.js source code then this is not your issue.

Alternatively you can open the file in the browser by going to:…

How to fix a PHP Fatal error: Allowed memory size of XXXXX bytes exhausted

If you're working with a PHP website, Magento in my case, and you get a page that is half blank when loading it's possible that you're experiencing a fatal PHP error.  This quick post will show you how to fix this in Magento

Verify that you're getting a fatal PHP error related to memory sizeUpdate your .htaccess fileUpdate your php.ini configuration
Step 1:  Verify the error

To verify that you are experiencing a fatal PHP error related to the memory size available you must first find your PHP error log file.  My host provides this through cPanel but if you're using your own Apache server it can usually be found in /var/logs/apache2/errors.log (see below).

Open using whatever editor you like (geany in my case), when opened, I was seeing this:

My log was giving this error:

[23-Nov-2011 17:13:12] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 169556 bytes) in /path/to/magento/app/code/core/Mage/Core/Block/Abstract.…

How to add a static block to a specifc category in Magento

Here's a simple tutorial on how to add a static block to any category page in Magento.

Create a static blockConfigure the custom layout for the category to show the blockRefresh the block cache To create a static block, login to the backend and go to CMS->Static Blocks. Click Add New Block from the top right. Enter whatever content you want the block to display, I'm creating a free shipping block for the left column.

<div class="block block-list block-shipping">
    <div class="block-title"><strong><span>Shipping</span></strong></div>
    <div class="block-content">
        <h4>Free shipping on every order!</h4>
        <p><img width="64" style="float:right;" src="{{skin url=images/box.png}}"> We now offer free USPS Parcel Post shipping on every order! No minimum order is required and no order is too large!</p>

How to increase the Magento admin session timeout

By default Magento sets the admin session to expire after 3600 seconds (1 hour).  So if you're working on adding a product and get distracted and have to leave, when you come back you're session may very likely be expired and all changes lost.

Luckily this is simple to fix, simply go to:


Set the Session Lifetime to a larger number (see below).

Next we have to make sure the session cookie doesn't expire.  Go to

System>Configuration->Web->Session Cookie Management

Set the Cookie Lifetime to a larger number such as 14400.

This method worked for Magento v


How to 'fix' flash not maximizing on the correct screen in Ubuntu 11.10

If you use two monitors or a separate TV screen in Ubuntu you may have noticed that when trying to maximise a flash video it maximises on the wrong screen.  Initially when you plug a second monitor the display manager will look something like the following.

I've not found documentation on this, but it seems as if Ubuntu assumes that the screen the furthest to the left is considered the primary screen.  So all you have to do is drag the second monitor to the left of the original monitor as below.

Click apply.  Now Ubuntu will use the second monitor as the primary screen (all dialogs will open there) and flash videos will maximise in this screen as well.

Good Luck!

How to reload sound drivers in Ubuntu 11.10

Every now and then I happen to get my sound to stop working in Ubuntu 11.10.  Sometimes this occurs when suspending and then resuming but most recently it stopped after switching the sound output from my laptop to an HDMI port.  Here's a quick way to fix this without restarting.

Open a terminal (ctrl+alt+t) and type:

sudo /sbin/alsa force-reload

Enter your password and it'll reload the ALSA sound drivers (see below).  Now go back into the sound settings and everything should work!

More info can be found here: