Upgrading to Magento 1.4.1.1 from 1.4.0

I recently had to upgrade an installation of magento 1.4.0 to version 1.4.1.1.  As anybody who’s ever tried to upgrade magento will tell you, the upgrade path is usually less than ideal (For some people the only way to upgrade from 1.3 to 1.4 was to manually export / import their data into a new installation)

As strange as it seems, it appears the most reliable way to upgrade an installation is to install the new version over a copy of the old version’s database. (Note, you should never attempt to install over the production database lest things go wrong!)

Here’s a quick guide on how I managed to get the installation in question upgraded, hopefully it’ll work for you too! :) Continue reading

Posted in Web Apps | Tagged , , | 7 Comments

Puppet: Retrieved certificate does not match private key

I’ve been playing around with puppet recently and while trying to start up a client and get it to talk to the server I ran into this error:

err: Could not request certificate: Retrieved certificate does not match private key; please remove certificate from server and regenerate it with the current key

Apparently the root cause of this error is that the client’s ssl certificates have been messed up.

To fix it you have to remove all of the client’s ssl stuff – cd into the directory containing all the ssl info – /etc/puppet/ssl for me running a manual install of puppet 2.6 – and remove all files, in all sub-directories, apart from ‘ca/serial’, which should contain 0000.

Then on the server revoke the client’s ssl certificate using:

sudo pupetca --clean {client hostname}

Then restart the client, resign it on the server and you’re good to go!

Posted in Virtualisation, Web Servers | Tagged , | 11 Comments

Config cache problems with Magento

After having numerous problems upgrading a Magento site 1.4.1.1 on a test server I decided to try and get it working locally before applying the fix(es) to the live server.

This is a fairly simple process and there’s lots of information on how to do it.  The key steps in the process are emptying magento’s cache directory and updating the base urls in the core_config_data table so that magento will generate correct urls.

Continue reading

Posted in Web Apps, Web Servers | Tagged | 4 Comments

Can’t connect to remote mysql server with php/apache but can through php/cli

Today at work we were migrating some sites to a new server infrastructure with the different services (i.e. php, mysql, mail) spread over different servers.

One problem we ran into whilst setting this up was that php scripts running through apache were having trouble connecting to the mysql server.

What was even stranger though, was the fact that this problem only appeared when the php script(s) were run through apache – running them through the command line / shell worked absolutely fine.

Continue reading

Posted in Computing, Web Servers | Tagged , , , , | Leave a comment

OSCommerce / Paypoint redirects to payment information after paying

I was asked to do some work on an oscommerce site which was accepting payments from paypoint (formally secpay) yet instead of redirecting the user to the “Thank you for your order” page it was sending them to the payment information page, and wasn’t classing the order as being paid for.

After a bit of debugging it turns out the problem stems from the paypoint-secpay merger and the fact that OSCommerce is a poorly supported hunk of junk.

Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Updated textarea maxlength with Jquery plugin

When I first wrote the “Textarea maxlength with jQuery” plugin last year I had no idea how popular it would be – over 70% of the visits to my site since then have been people reading that one post. The problem is, the code there is basically an ugly hack – you copy and paste and you’re done. But if you need to implement the same functionality across a site with slight differences to the functionality, you’d end up with a lot of copy and paste garbage. Continue reading

Posted in Programming | Tagged , , | 39 Comments

Testing Kohana3 with PHPUnit

Unit testing is great, period. It allows you to test different parts of your application independently of the rest of the system.  Any changes that will cause problems elsewhere can be identified almost instantly (if you’re doing it right!).

Up until recently Kohana3 was using a home-grown module for unit testing – It was ok, but lacked some of the more advanced features of independent testing suites – however now the project has now adopted PHPUnit as its official test framework!  PHPUnit is one of the more popular testing suites for PHP, it has full support for FixturesMock ObjectsCode Coverage and a lot of other cool stuff.

The module only requires a few changes to the bootstrap in order to integrate Kohana with PHPUnit, and afterwards you can run tests from the cli, IDE or our custom web runner.  All available tests are loaded from Kohana’s cascading filesystem and can be filtered using PHPUnit’s –group switch.

Go and git it while it’s hot!

Posted in Programming | Tagged , , , , | 13 Comments

How to get Ubuntu to ping a Windows hostname (and vice-versa)

I’m currently running ubuntu server in a virtual machine on my pc, and one of the annoying problems I’ve always had with ubuntu is that it never seems to be able to resolve the hostnames of machines running windows.

After a little bit of digging I found a really simple solution in this forum topic

All you have to do is:

sudo nano /etc/nsswitch.conf

change the line that says

hosts: files dns

to this:

hosts: files wins dns

(order does matter)

finally, you need to install winbind

sudo apt-get install winbind

To enable windows to ping ubuntu you then need to install samba:

sudo apt-get install samba
Posted in Computing | Tagged | Leave a comment

Virtualbox – 1 differencing child hard disks

If you’re getting an error along the lines of “{hard disk} cannot be directly attached to the virtual machine because it has 1 differencing child hard disks”

Then the solution is to delete the virtual machine (but not the hard disk!) and then recreate the machine using the hard disk.

Posted in Computing, Virtualisation | Tagged | 23 Comments

Stretch wallpaper across multiple monitors on Windows

When I first got a second monitor I looked around for quite a while to try and find a solution for stretching a wallpaper across dual monitors – Windows was repeating the first half of the wallpaper on both the monitors.

Continue reading

Posted in Computing | Tagged , | 2 Comments