Wednesday, 21 December 2011

Upgrade of Moodle 1.9.10

Because this time of year is so quiet, I thought that I would do a small point release upgrade of my standard Moodle 1.9.10 install to the current latest version of 1.9.15 as of today.
There are a few reasons that I wanted to get this done and out of the way before January.  Some of my reasons were:
  • General bug fixing;
  • Performance upgrades;
  • Module enhancements;
  • Preparation for Moodle 2.x upgrade;
Even though I know that none of these reasons were particularly urgent, my main reason for doing so is in for the preparation for our imminent update to version 2.x quite shortly.  I've used x because from what I have read, version 2.3 will be out around June 2012 and so that will most likely be the one that I'll be going for.  My work so far to upgrade our version 1.9.10 to version 2.0.6 didn't go so well as I ended up finding lots of small errors that hindered the installation, but upon upgrading to 1.9.15 prior to upgrading to version 2.0.6 many of these errors (mostly relating to blocks and modules) went away.

Anyway, as for the update.  It actually went very smoothly and quickly.  The entire update was done within a few minutes.  This is what I did in preparation:
  • Backup the database and file structure;
  • Copy over the top of the existing files with the new files;
  • Run the update;
There was one new setting that was asked for which related to the automatic storing of passwords in browsers, but other than that nothing.  Point releases generally should only be done if you have problems but in my case it was more about preventing future problems than fixing any major current problems.

Note to all those upgrading from 1.9.x to version > 2.0.x, make sure that you upgrade to version 2.0.x first before attempting to upgrade to either 2.1.x or 2.2.x. The changes made in version 2.0 were large and so it is recommended within the Moodle documentation that you do this first.

Monday, 19 December 2011

IE6: The End Nudges Closer

Microsoft has today announced that from January 2012, Internet Explorer updates will automatically be downloaded and installed in the background whilst retaining all of your custom settings like addons and search providers.

The new feature will work for those who have automatic updates enabled on their machine and this means for anybody using Windows XP you will be jumped up to version 8, whilst if you are on Vista or Windows 7 you will be pushed to IE9 whether you like it or not.  This is definitely a good thing for Microsoft as it means that the death of IE6 just moves that little bit closer.

In the past I have criticised Google and Mozilla for pushing out these updates on the stealth as it means that developers are constantly having to make changes - especially when they both at the moment are doing a new release every eight weeks.  In terms of security, this is most definitely a good thing for the Internet as a whole.  I myself as of earlier this year completely dropped support for Internet Explorer 6 as it was simply becoming too difficult to maintain. has the world usage for IE6 pegged at 8.3% as of today, with certain countries faring better than others.  For example, the UK has 1.8% and the US has 1.0% - fairly impressive, however China is massively behind here at a massive 27.9%.  I can only put this down to counterfeit software but whatever happens, the Internet will go on with and without it.

As a final note to those of you out there still using IE6, please, please, please update!

Thursday, 15 December 2011

Manage Memory Limits SQL Server Enterprise 2008

Currently on our network is a server that's running SQL Server Enterprise 2008 running on our Hyper-V cluster.  On the cluster, dynamic memory is enabled.  Now, normally this isn't a problem, but when configured incorrectly SQL Server Enterprise will eat up as much data as it needs and so you suddenly have a server (low usage) that is eating up 14gb of memory.

The solution is to go to SQL Server Management Studio and right click on the server in the task pane on the left and go to properties.  Under memory on the left is an option to set max server memory in megabytes.  By default this is set to 2147483647mb (maaaaaaaassive).  The minimum you can set this to is 4mb but that would be silly now and so after a bit of a debate we decided that 6144mb (6gb) would be a nice number.  It now means we can continue to use dynamic memory on the VM without having to set static amounts of memory for the server itself.

Wednesday, 14 December 2011

Chrome 16 Out Now

Today sees Chrome 16 released as part of the Google rapid release cycle.  With it comes the ability to sync your life, for example when you upgrade to version 16 your home machine with Chrome and your work machine with Chrome will share everything like your extensions, settings, history, bookmarks and other things between each other.

Obviously, in able to do this you will need to pair your Chrome with your Google account which also has other benefits including being automatically logged in to any Google based sites.  Is this potentially dangerous though especially with Google + (Plus)?  The jury is out on that one for now I think.

Personally for me, this is where Mozilla is going wrong with Firefox.  These features simply don't exist and once upon a time it would have been Firefox with all of the new bells and whistles so for me this deserves a pat on the back.  Well done Google!  Now that Mozilla are following Google with their rapid release cycle, I think it will be even harder for Mozilla to keep up.

Chrome 16 is available to download now, or if you already have Chrome installed then just sit back and wait patiently for Chrome to update the next time you load up your browser.

Moodle 2.2: Coming to a Webserver Near You

Last week saw the release of Moodle 2.2, which actually wasn't a long time since we saw the release of version 2.1, and again wasn't long before we saw the release of the rather buggy version 2.0.  Me?  I'm still sat here on version 1.9.10 because of this rapid release cycle.

See, the problem is, during the year it is very difficult to suddenly make changes that users aren't used to and for that reason I usually do my system upgrades at the start or end of the academic year.  I hope for the sake of Moodle and its massive following is that this isn't a sign of things to come.  They really need to focus on quality at this point as once upon a time, I had originally planned to jump on the Moodle 2.0 bandwagon and am I glad that I didn't.  After I installed it on my test web server, I soon found that I had made the right decision.  Simple things didn't behave as expected and so I actively discouraged those who asked me about version 2.0 to not go ahead with the upgrade.

2.2 takes off where 2.1 finished and adds to many of the new features found in 2.0 onwards including many bug fixes.  In the release notes, Rubrics, external tools, common cartridge and Mymobile themes are all mentioned.  The notes also have a small mention about version 2.3 due in June 2012 and so I will most likely be hanging on for this release.

Friday, 9 December 2011

Correct Silly HTML Mistakes

For those of you that have read my blog, you will know that I'm a little OCD about website performance - and so should you be.  If your website becomes the source of frustration for an end user, more often than not you will lose your viewer and since the choice on the web is now so vast, you may not ever get them back.
For every mistake that is made in your code, your browser has to interpret what it is that it should be doing.  Not a problem you think?  Well you might be right, but squeezing every ounce of performance should be your key goal.  Just using a handful of my favourite tools will highlight any problems that you have very quickly.  These include:
  • Firefox / Chrome Plugins: Google Page Speed, HTML Validator, Firebug, Web Developer Toolbar and YSlow
  • W3 HTML Validator (bit of a given really!)
These tools are brilliant, but if you can avoid making some mistakes in the first place you have less work to do later on making changes and refinements to your code.  For example, say you have inserted an image into your website and it displays correctly, but is missing the alt, width and height parameters, then your browser will identify three errors with that particular image element, which you then have potentially replicated elsewhere in your page.  One solution to partially get around this is to use some form of dynamic language to call a function that will display your images for you correctly each time.  Below is a quick image function to show you what I mean.

function show_image($url, $width, $height, $alt) {
     return '<img src="'.$url.'" width="'.$width.'" height="'.$height.'" alt="'.$alt.'" />';
You could include this in your header or whatever and then call it each time you need an image on your page.  This way, you are forced to have each parameter so that your image will be displayed properly.  The function could also be expanded to include JavaScript, Class and ID parameters etc. but for a quick and easy solution there isn't much else better.  You could then apply this theory to other elements on your page and you will quickly then get the hang of things.

Always, always run a validate check to see if your code really does validate.  If you are confident in your code being very good, you could think about making your site XHTML 1.0 strict and while this sounds easy, it sometimes isn't and could mean that you have to redesign part of your site to compensate.

Other areas that will offer performance increase are:
  • CSS sprites;
  • Too much JavaScript;
  • Images that are too large for the job, i.e a 16x16 image shouldn't be 10kb;
  • Cache as much of your code that won't be changing, i.e. JavaScript;
  • Minify your HTML, CSS and JavaScript;
  • Avoid DNS lookups;
  • Too many HTTP requests within your page;
Revisit these steps often and you will be surprised about the difference that it makes!

Monday, 5 December 2011

PHP: mysql_fetch_assoc Vs. mysql_fetch_array

Recently I've been doing a lot of work to optimise my work so that pages load more quickly and server load is reduced.  When I was looking through to my database calls, typically I've always used the mysql_fetch_assoc function because it always returned less data than the mysql_fetch array which actually returns two arrays - one which has a numeric index and the other which has an associative key index.
Having a play around and doing some benchmarking between 1,000 and 10,000 iterations of a fairly small amount of data, I found that the mysql_fetch_assoc function was between 24% and 31% faster than the mysql_fetch_array function.  Good news for me really as this is how I typically return data from my MySQL database and so I won't be doing any rewriting any time soon.  This is what I expected really as the size of the data processed and returned is half (well less than that really because it's numeric) so good news here.

Of course there are occasions when the mysql_fetch_array function is needed and I'm not questioning its existence at all, but purely as a benchmarking exercise I would pick mysql_fetch_assoc everyday.

As a side note, it's also important that I mention the mysql_fetch_object function as well which is for those of you who prefer the OO notation.  However, using the same benchmark against the mysql_fetch_assoc function, this is still on average between 8% and 14% slower.

I hope this helps anybody who is currently in the process of performance tuning.  Every little bit saved does help to improve the user experience.

Friday, 2 December 2011

Browser Wars: Chrome Steps Up

In yet another bout of good news for Mozilla, Chrome has displaced Firefox as the second most popular browser according to research boffins at StatCounter.  Microsoft's Internet Explorer still holds the top spot by quite a large amount, but what is most surprising is the time that it has taken Chrome to establish itself in the number two slot.

Chrome has been around now for quite some time, but not nearly as long as Firefox.  The Chrome market share now stands at 25.7%, while Firefox has dipped to 25.2%.  Not a massive amount I agree, but this could be a sign of things to come.  StatCounter point out that just two years ago, the Chrome share stood at just 4.5% and so this is a massive achievement for Google.

Firefox seem to be trailing in strategy as well, as they now seem to be following Google with their own rapid release cycle methodology (albeit rather annoying at the same time).  I'm not entirely sure that Mozilla have been doing anything massively wrong as such as of late, but they don't seem to have the innovative touch that they once had.  Bugs crop up from time to time as they do with all browsers and I'm adamant that Firefox is the best browser for debugging as it has the widest range of addons available right now.  I think that it's time for Mozilla to regain that creative spark that it once had, rather than becoming the market follower.

Tuesday, 29 November 2011

Mozilla Adds Flash to Firefox Android

Over at the Firefox Nightly builds site, Mozilla have released Firefox for Android with 'experimental support' for Flash.  After Adobe publicly killed off mobile Flash earlier this month, this turned up as quite a surprise.  I've installed it on my Android phone and I must say, it's actually quite good.  It's not quick, and it sometimes judders a little as Flash on a mobile always has been, but that's a given really.  I suspect that my phone was partly to blame here as well.

Even though this isn't sold as a stable release, I didn't experience any problems with Flash or the browser itself.  I would even say that in a way, I preferred it to the standard Chrome install on my phone.

Could it be that mobile Flash will eventually be spun off into an open source project for the wider Internet community to take hold of?  Only time will tell, but don't expect to see the final version until early next year.

PHP 5.4 On The Way

Earlier this month PHP 5.4 RC1 was released to the general public.  No big deal you might be thinking, but actually I noticed a small change in the latest release that could potentially be of massive help.
The note specifies 'Added class member access on instantiation (e.g. (new Foo)->bar())' which could be very handy if you only need quick access to a function from within a class.  OK, not massive I agree but sometimes for some of the smaller classes that I have this would be great.
Other improvements include the usual round of bug fixes and improvements in both the core and extensions.
Anybody considering PHP 5.3 who is on a version of 5.2 or less should hang on for a week or two until the final release.

Wednesday, 16 November 2011

Mobile Flash is Officially Dead

Now that Adobe has publicly killed off Flash for mobile devices, what are the wider implications for the rest of the development community?  Well, hopefully it will be a brighter future thanks to the emphasis on HTML5 that the company seems to be placing all of its eggs.

It's certainly been a long time coming, and to be perfectly honest I'm not surprised at all.  There are many reasons, just take your pick as to which is your favourite.  The big two are cost and the lack of cross-platform access which Apple unfortunately has had its way with.  There are very few companies now that develop sites in Flash as it is far more costly, harder to work with and lacks many of the standard accessibility features that most browsers apply to standard HTML websites.  The cross-platform thing has certainly hasn't done Adobe any favours, but to be fair I don't think Adobe have done themselves any favours either.

I forever hate updating my machine whenever a minor point release of Flash is released, which at the moment seems to be every week as soon as Windows starts.  Really, is that absolutely necessary?  I'm sure it isn't.  Then one point that I do agree with Apple on, is that it is a battery killer because it is very CPU intensive.  Even though on the PC Adobe have now shifted some of this load to the GPU, it wasn't enough.  It also took them forever to release a 64 bit version of Flash, which is something that I've never understood.  For a company as big as Adobe, it's a huge let down.  Is the desktop going to be the next one to fall?  Apple no longer include Flash as part of their standard OS installs (again, no surprise there), so it's a sincere possibility.

The good news is that is seems to be a victory for web standards and compliancy and it's something that I almost always do my best to conform to.  While mobile Flash won't be going anywhere soon, it certainly is an admission of defeat for Adobe.  Even Microsoft haven't included Flash in its latest mobile operating system so it was probably best that Adobe gave up sooner rather than later.

Personally I've never really liked Flash.  It has always been difficult to develop and so I always skated around the subject when it came up, but now, it's a sign of relief that I know to put my eggs in the HTML 5 basket.

Installing PEAR Packages on Windows

Ok, so now that you've read my previous post about setting PEAR up on Windows, it's time to start installing some packages that will help you on your way.

An absolute must for any sort of database connection is the DB package.  You could argue that the built in database connectivity from the PHP modules is good enough, and you would be right.  There is a certain degree of flexibility in using these packages though, as they are continuously updated throughout the year by a large community (as is PHP), but in some cases it's all about how you interact with your database connectivity as you will see, it's certainly more class driven in how it's all written.  For example, there is support for scalar parameters as shown below (taken from the PEAR documentation):

// Create a valid DB object named $db at the beginning of your program...
require_once 'DB.php';
$db =& DB::connect('mysql://usr:pw@localhost/dbnam');
if (
PEAR::isError($db)) {

// Once you have a valid DB object named $db... 
$sql  'select * from clients where clientid = ?'; 
$data 53; 
$res =& $db->query($sql$data);

// Always check that result is not an error

if (PEAR::isError($res)) {

This has certain other benefits including the potential for easy cross-platform availability (bar the changes to the SQL syntax that change between SQL servers).  One thing that PHP 5.x users will need to do is replace the '=&'s that tend to crop up as they are now depreciated because of PHP 5.x; these can just be replaced by a simple '='.  If you have errors switched on (which I would at this point during installation and testing), you will most definitely see these being pointed out as errors.
The full list of functions is available under the documentation for each of the specific packages, and so the many other functions for the DB package are listed here.
So now that you know how to use it, it's time to install it.  Launch a Command Prompt, and browse to your PHP folder.  Once there, type 'pear install DB' and press return.  Congratulations.  You've now installed the DB package, it really is that simple.  To use it, you will need to have either an include or a require (as shown in the example above) to reference the DB package (DB.php).

Other packages within PEAR tend to reference this class in some way so it's always a useful one to install.  At the time of writing, DB has been superseded by MDB2 and so that is something that is also worth a view.

Installing PEAR on Windows

This really is just a short quick guide on how to install PEAR manually on a Windows box.  There are currently multiple ways of setting PEAR up, and I'm going to show you my preferred way, only because it's easy to fault find in case anything goes wrong.

For those who don't know what PEAR is, PEAR is essentially a customisable framework of many components that you can choose to have on your system.  It really takes aim at giving access to functionality that doesn't exist with the standard PHP functions.

First thing first, you will need to have a working copy of PHP installed and working on your system (preferably the latest version), and that is really about it.  You should notice that you already have a PEAR folder in the root of your PHP folder anyway, and so this ready and waiting for you to activate the features.

To do so, open a Command Prompt (go to Start > Run > type 'cmd' and press enter) and navigate to your PHP folder.  Once you've made it there, the command prompt on the left should be showing that you are in the root of your PHP folder.  If not, you are in the wrong place.  It should look something like it does here on the left.

Next, type 'go-pear' and hit return.  You will be asked if you would like to install a system or a local copy, so you will need to type 'system' here.  Once you have done this, you will be presented with 11 options that specify locations of your files and folders.  Normally this is correct straight out of the box, but if you like many people move your PHP folders then you will need to update these locations.  When you are ready, hit enter again, and off it goes.

The next screen will show PEAR installing and when it's ready there will be a small paragraph at the bottom asking you to execute a reg file that has been placed in the root of your PHP folder called 'PEAR_ENV.reg'.  Don't worry, this is completely harmless as this just lets Windows know that PEAR is up and running on your system.

And, well, that's it really.  You've set PEAR up on your system and are nearly ready to go!  All you need now are some packages that are freely available from the PEAR website.

Saturday, 29 October 2011

Opera 12 Alpha + Hardware Acceleration = Fast!

Last week saw the release of Opera 12 Alpha with full hardware acceleration for WebGL graphics.

Opera 12 Alpha can be downloaded from their site over here.

The main benefits being touted include:
  • Faster graphics with hardware acceleration
  • New HTML5 engine
  • Faster browsing with reduced memory usage
  • New themes
  • New address field
  • WebGL support for games 3D content
All in all it's looking good for this release.  To get the most out of Opera 12 Alpha although you will need to have a modern graphics card with up to date drivers.  DirectX support isn't in there yet  but the notes claim this will be available later at some point.

It's a good release for an alpha and it feels smooth and speedy.  I still find that some pages look a little odd sometimes in Opera, and it's something that has happened over the past five or six releases and I have never worked out why.   That might just be me, but I don't think it is.  It's also a bit of a memory snatcher as well, but this is quite typical of an early release.  It's worth a try anyway.

Firefox 7 Released (three weeks ago!)

In a rather delayed post, Firefox 7 has now been released, wooo!  The release comes just six weeks  (yes you read that correctly) after Firefox 6 arrived.  The two major selling points of this release are speed (as ever!) and the memory demand has been reduced by half, which is quite impressive.

Over the past few releases, I have noticed that Firefox has become a bit of a pig for the amount of memory it uses.  Why that is I'm not sure, but anything like this is always a welcome boost.

For web developers, the news gets better.  Navigation timing spec will benchmark your pages which I'm all in favour of as this is something that I've always tried to run to get the best out of the user experience.  More good news comes from the people that make Firefox who claim that this release will be less likely to break your addons.  There is better support for compatibility with your older addons that were download from their own site, however bits from elsewhere may not work as well.

Firefox Silent Updates

Future versions of Mozilla Firefox will shortly be delivering updates to your computer without you even knowing about it, saving users the bother of downloading and installing updates.  Good idea?  Maybe.

Right now, both Firefox and Chrome are seeing frequent updates and if reports are to be believed, Microsoft will be joining that party soon with the development releases of Internet Explorer 10.  The danger is that users are no longer aware of these updates and what benefits they will bring.  Personally, I'm a little bored of minor releases being marked as new version releases which I feel Firefox has been doing as of late.

Notifications are irritating, full stop.  Every time I load Firefox at the moment it tells me that an update is available.  The problem is, I don't want to update.  The last time I did this, it broke all of my addons which is one of the reasons that I use the browser in the first place.  Ironic.  This will also cause problems in large companies where users do not have permission to install updates and then deployment also becomes a problem.  This is why most companies use Internet Explorer which ties in nicely with other Microsoft products so that updates are easily deployed along with security fixes.  Right now, Mozilla say that they are testing a Windows service that will install an optional component that will automate the update install without UAC prompts.  Sorry, but if something changes on my machine, I want to know what is going on.

This is both good and bad, but perhaps they need to start to change the approach that they are taking right now.  The benefits may outweigh the problems.  By taking the rapid release cycle approach, we are constantly moving forward so that we are no longer stuck with older browsers like we had with the IE6 fiasco.  I really am in favour of this as the envelope of web technology is constantly being taken forward.  As long as the way in which pages are rendered doesn't change, this is good with me.  I remember when IE7 was released and many developers complained back then that had to write hacks to get their code to work with IE6.  This can't be allowed to happen again.

So yeah, as you can imagine I'm a little divided!

Tuesday, 23 August 2011

Google Page Speed for Chrome and Online

Another of my favourite performance tools for reducing every millisecond from loading times is Google Page Speed.  Although it's a little fiddly to install (fiddly in the sense that it takes more than 30 seconds), it's still a brilliant extension to have for Chrome.

If you already have Chrome, take a look over at the Page Speed site for what it brings to the table.  The install notes and download links are available here.

Again, I recommend using this in addition to certain other tools so that absolutely everything is covered.  Other tools that you really should use are: -
Don't take everything that these tools say as gospel though.  There are some things that you might absolutely need to load first, i.e. your JQuery JavaScript for example.  And while I'm about JQuery, Page Speed also picked up errors in the code that aren't your fault and aren't easily correctable so you will get marked down for those.  Other things in there are quite easy to correct, such as where you've specified an image but missed out the image dimensions for example.  I managed to get my site up to 98/100 which I'm quite happy with.
Some of the recommendations that it will ask you to make include: -
  • Minify HTML and JavaScript;
  • Combine images into CSS sprites and avoid CSS @import;
  • Optimise images and specify dimensions;
  • Specify a character set;
  • Put CSS in your document head;
I found that it made a small difference, but if that difference is your user sticking with you and the user going elsewhere, it could well be worth a small amount of your time.  Oh and lastly, there is an online version of this available as well.  Head over to Page Speed Online and give your site a test.  It should also be noted that there is a version available for Firefox versions 4 and above.

YSlow now Available for Opera, Chrome in Beta

For those of you who have read some of my previous posts, you will know that I'm a big fan of the YSlow extension that until now has only been available for Firefox.

For those of you who don't know what YSlow is, it's basically a small tool that analyses every part of page performance.  Each aspect of your site is graded and improvements are suggested.  If you get a chance, have a read through my post on 'How to Speed up Your Website' where I use YSlow in combination with a number of other tools that really work.

Chrome users can have their cake as well, albeit a slightly smaller piece until it leaves the beta stage.  Version 3.0.6 is available from the Chrome Web Store right now.

YSlow really is one of the best tools out there for squeezing every drop of performance out of your pages.  Be aware for those people who want to use this who are using Firefox, you will need to have the Firebug extension installed.

If you want to get started, here is what you need to do.
  1. Using Opera for desktop, install the extension from the Opera extensions sites.
  2. Visit the website you'd like to measure the performance of.
  3. Click the YSlow icon in your toolbar, then click the "Run Test" button.
For more details about YSlow, take a look at the main YSlow site.

Monday, 22 August 2011

Beef up your Security with HTTPS Everywhere

EFF have released HTTPS Everywhere version 1.0 for Firefox as the project has recently come out of the beta testing stage.

The question is, why should you use it and what does it give you?

Well, in a nutshell it enables you to browse the web securely, even when you don't realise that you aren't browsing an HTTPS enabled website.  The problem with a lot of what you do is that a lot of your requests are sent over a vanilla HTTP connection, which is, err, insecure.  For example, your normal request to will be redirected to  Simples!

HTTPS Everywhere addresses this issue by rewriting all of your requests to HTTPS.  Full details of the product are available here, and the download is available from here.  It also boasts that it now supports over 1000 websites including all of the big names such as Google, Wikipedia, Twitter, Facebook and PayPal to name a few.

If you use Firefox, then this is a must as 'it just works' to quote Apple without you even noticing.

If PHP Were British...

I've just come across this great article from AddedBytes which is quite frankly, brilliant!

It's a bit tongue in cheek but very funny if you read through the article.

Taken from the article:
When Rasmus Lerdorf first put PHP together, he - quite sensibly, despite his heritage - chose not to write it in Greenlandic or Danish. Good job too - that would have been rather unpleasant to work with. He opted instead, being in Canada at the time, for the local tongue. No, not French - that bastard dialect of the Queen's English commonly referred to as "US English".

PHP developers in Britain have been grumpy about this ever since. What was he thinking? And more importantly, how do we undo this travesty? How do we developers ensure the traditions of the British Empire continue to be upheld, even in the digital age?

Wednesday, 17 August 2011

Chrome 14 Beta Brings Native Code

In not so new news this week, Google has released Chrome 14 to the beta testing channel which brings with it Google's Native Client technology.  The download is available on their beta downloads pages.

So what does all this mean?  Well in short, quite a lot.  To read more about it, head over to Google's Native Client SDK pages which explains everything in much more detail.  To summarise quickly, it allows compiled C and C++ code to run within the browser which in theory means that anything you write will be able to run on any of the major platforms giving almost true application portability.  It also in theory could reduce security threats because Native Client utilises what Google calls a 'double sandbox' so that system security will be difficult to penetrate.  Performance should also be enhanced, as desktop applications will be able to run within the browser.

If Google get this right, it should allow for a much better browsing experience, and it ties directly in with their Chrome OS strategy with the browser being a key application to do most things on the OS.  And if they do get this right, it would allow web developers to utilise code libraries from multiple platforms.  Sounds great!

If you get a chance, download Chrome 14 and take a look at their Native Client demo here.

Firefox 6 Now Available

An update to the already brand new Firefox 5 is now available to download.  The update comes just two months after Firefox 5 was released.

Recently since Firefox 4, Mozilla appear to be on a quick release cycle which other browsers such as Google Chrome seem to be following.  The download is now available on the Mozilla site, and has now been pushed to the automatic update feature within Firefox as of this morning.

After updating yesterday, it seems that there is little or no difference in functionality.  Digging a little deeper, it appears that 5 brings performance increases of about 20%, which isn't too bad at all.  Visually, is it almost identical.  The only minor note is that the domain name is now bold in the URL bar at the top.

What has frustrated me about this release so far is that quite a few of my add-ons were incompatible with this new version which I use on a daily basis.  I think that Mozilla should have made more of an effort to support these better so that they work from day one, but that hasn't happened.  For that reason, I've gone back (even though I hate doing that) to version 5.0.1, which is available here on all platforms for those people who have the same problem.

Tuesday, 16 August 2011

Internet Explorer 9 Security: Top of the Tests

In what you could say is a surprising twist of reputation, NSS Labs have revealed what they think is the most secure of all browsers for malware and malicious websites, and yes you've guessed it by now, Internet Explorer.  One of the many articles can be found over at ZDNet.

Anybody who knows the previous chequered history of Internet Explorer will know that Microsoft have been highly criticised for its vulnerabilities and many patches that have given it such a poor reputation.  To be fair to Microsoft, they have been fighting back hard as of late.  Internet Explorer 9 is much more enjoyable to use, and it has a much cleaner and compact appearance.  I'm not a fan of any browser in particular being honest.  The main reason that I stick with IE is because that's where my users are.  Yes, I have to make sure that my code works properly in all browsers but first it needs to absolutely work here.

The article above goes on to mention that even with the built in application reputation technology disabled, IE9 still managed a URL blocking score of 89.5 percent and an overtime protection rating of 96 percent.  In the same NSS Labs tests, Firefox 4 and Safari 5 both scored 7.6 percent for filtering malware, with Chrome 12 faring slightly better at 13.2 percent.  The total blocking rate for IE9 is now at an impressive  99.2 percent.

I really hope that Microsoft carry on doing well with IE, not because I have any preference toward them, but because they really are making some excellent products at the moment.  The days of IE6 are almost well and truly behind them.

One last thing which is just a quick thanks to those who have been reading my blog as of late.  If anybody wouldn't mind clicking through on my sponsored links it would be really much appreciated.

Thursday, 4 August 2011

Google Chrome Jumps to Second in the UK

Oh dear, it really hasn't been a good month or so for Mozilla.  Not only do they not have any niche anymore as I discussed recently, but now they have slipped into third place behind Chrome in the UK.

According to Statcounter, Google Chrome has now jumped to second place in the so called 'browser wars' in the UK (still second worldwide).  Google Chrome has only been with us now for a short while, 3 years in fact but already it has made good inroads into the market.  The statistics that Statcounter has shows the following in the UK:
  • Microsoft Internet Explorer (45%)
  • Google Chrome (22%)
  • Mozilla Firefox (just under 22%)
  • Apple Safari (9%)
Both the market share for IE and Firefox has been on the decline as of late, whilst Chrome and Safari have taken advantage of the enlightened user awareness of alternative browsers.  Google certainly have made the most of this with their recent dip into television advertising which highlights the benefits of Google and Chrome together.  A couple of things that Google has been shouting about is speed and security.  The other browsers historically have had problems with both of these areas, so it's all about taking advantage.  And to be fair to Google, Chrome is very, very fast.  When Apple ported Safari across to Windows, they made big statements about the browsing experience, with speed being one of these areas although they have been very quiet as of late, almost standing still watching the others slug it out.

Google really won't be giving up on this one.  Logically, Google has more to gain from any of the other three companies listed as Chrome is essentially a base product for all of their other products.  Firstly there is the new Chromebook which in my opinion really is a mile away from being a full consumer product.  I'll do a Google here and call the Chromebook a beta product, because essentially that is what it is.  It's not a spot on either a Windows 7 or an OSX laptop but that's another story for another day.  Next, it links in with Android, which again has made massive inroads in the smartphone market.  Then there is the biggest product, search.  This is where Google makes its money and it comes from advertising, sponsored links and affiliate links.

So really, it's all about the money, and Google are good at making money.

I'm still thinking though that Internet Explorer will be king for a while to come yet.  Not only have they released a good browser as of late, there are plans for Internet Explorer 10 which take on more of the HTML5 and CSS3 specifications. With this, I expect that they will stay static with their market share, or even gain some back.

So back to Firefox.  They really are taking a kicking at the moment.  Yes they are still second globally, but for how long?  They won't be losing third place to Apple, and they won't be getting first place either.  They need to do some work I think!

Wednesday, 3 August 2011

SQL Server and Dynamic Memory

Since our move to Hyper-V and the addition of Service Pack 1 for Windows Server 2008r2, the addition of Dynamic memory has helped us vastly manage the resources within our virtual servers much better.  For those who don't know, Dynamic Memory is where the memory utilised in virtual environments can be changed dynamically while the virtual machine is running.  For this to work the OS needs to be aware and it is something that SP1 does nicely for us.

I came across something odd a few weeks ago after deploying a new virtual machine running SQL Server 2008 Standard Edition.  The server had plenty of resources as the OS was able to utilise much more memory as and when it was needed.  The problem was that the SQL Server would fall over without notice.  After reading through the logs, it soon became apparent that the SQL Server would continuously keep running out of memory.  The virtual machine has its settings set to a minimum of 512mb of memory, which will balloon when it is required.  The problem is that the standard edition of SQL Server uses a fixed amount of memory from the OS when it's running and it's not able to ask for more resources.  The only editions that can utilise Hot Memory are the Enterprise and Datacenter editions.

So the moral of the story is that the next time you install your SQL Server and you are running on the Hyper-V platform, it always almost certainly will benefit you to install the Enterprise edition so that you don't need to set your virtual machine to use a much higher fixed memory that the other virtual machines running within that pool can't use.

Thursday, 28 July 2011

PHP 5.2 ISAPI to PHP 5.3 FastCGI

If like me it took you a little while to move from ISAPI with IIS to using FastCGI then fear not, you aren't alone.  Being honest, ISAPI with IIS went very well together as it was fast and very easy to setup.  Future versions of PHP no longer support ISAPI as of version 5.3, so you may as well make the move sooner rather than later.

So what do you need to do?  Well, firstly, download the latest build of PHP for your system (download the NTS version, which is the non-thread safe version).  Extract it somewhere on your system i.e. c:\PHP or wherever you mostly feel comfortable.  Next, assuming that you are using either Windows Server 2008 or 2008 r2, go to your Server Manager console, and then click 'Roles' on the right.  Next, click the link on the left named 'Add role services' under the Web Server (IIS) heading. This is assuming that you have IIS already setup on your server, otherwise you will need to add this as a role to your server. Drop down the 'Application Development' box and check the 'CGI' box as shown below.

As you can see, I still have my ISAPI extensions still in there but we can remove those later as we won't be needing them.  Click 'Next' and then let Windows go off and do its own thing.

Ok, your PHP config.  Do what you would normally do here.  In addition to your normal PHP config which can mostly be copied from your old PHP 5.2 config you will need to change the following:
  • cgi.fix_pathinfo=1
  • fastcgi.impersonate = 1
  • cgi.force_redirect = 0
  • extension_dir = 'c:\PHP\ext' *or where you have your PHP extension folder*
  • open_basedir = *location of your wwwroot folder typically*
Don't forget to change those asterisk comments to real values!  Ok, next back over to IIS, so open your IIS Manager.

Click on your server on the left hand side.  In the central pane will be an icon called 'Handler Mappings'.  Click on that, and then go to 'Add module mapping' in the right hand pane.  Fill in the following details and click 'OK', and then 'Yes' in the popup box when you are finished:
  • Request path: *.php
  • Module: FastCgiModule
  • Executable: *Link this to your PHP folder and then your php-cgi.exe file*
  • Name: PHP FastCGI
Next, you will need to do is go back to your server on the left hand side and then click 'FastCGI settings'.  When you get there, click the PHP entry in the middle, and then click 'Edit...' on the right.  Change the InstanceMaxRequests to 10000, and then click on the '...' button under 'EnvironmentVariables'.  Add an entry of PHP_FCGI_MAX_REQUESTS with a value of 10000, and then click 'OK'.  If you don't do these steps, IIS uses its default settings of 200 instanceMaxRequests and 500 PHP_FCGI_MAX_REQUESTS.

Nearly there now.  Make yourself that old PHP test file with the following information: <?php phpinfo(); ?> and see if it runs.  Chances are if you are on a 64 bit system this will have failed unless you tell IIS to use 32-bit applications.  To change this, go to the Application Pools, and then go to your website in the central pane.  Click 'Advanced settings' and then a popup box will appear.  Change the 'Enable 32-bit applications' entry to 'True'.

Assuming that you have set up the rest of your php.ini correctly, it's a case of job done for now!

Tuesday, 26 July 2011

Mobile Firefox on the Way

Following on nicely from my post a few moments ago, Mozilla have just announced that they are starting working on a mobile version of its popular desktop browser.

You have to feel for Mozilla at the moment as things aren't exactly going brilliantly.  When I say this, I mean it with a pinch of salt.  You will always have those people out there who love Firefox and those who swear that it is the best thing since sliced bread but, and this is a big but, they really must be feeling that they are out in the ocean on their own at the moment.

Microsoft have Internet Explorer, Apple have Safari and Google have Chrome.  So that's desktop and mobile covered for three major platforms at the moment, with only the various Linux flavours not covered. question is, is there any point to this?  I'm thinking probably not.  In the early days of iOS, rumours were rife about a mobile version of Firefox, but the rumours were denied and they never turned into anything more than gentle whispers in the wind.  I think that they've missed the train and are now playing catch up.  They should stick with what they are good at, or innovate with a new niche product that nobody else has.

I still need you Firefox for development, so don't go anywhere anytime soon!

Google Abandons Google Toolbar for Firefox

In what can only be said is a predictable event, Google this week has announced that it is halting development of its Firefox Toolbar.  With Mozilla releasing Firefox 5, there is no in-place upgrade for those who want to continue to use the toolbar.  Has Google shot itself in the foot though with this one?  After reading many Twitter comments over the past few days, this is a sincere possibility.

Let me get one thing clear, I hate the Google Toolbar.  In fact, I hate all search toolbars.  They clutter your screen, they spy on what you are viewing, they slow your browser down and also they take up valuable screen space.  Ok, so you've lost the translate features.  Oh wait, no you haven't.  Google still have that little 'translate' link on each of their search results so really it is still there, but you will have to go the long way around to get to where you want to be.

The problem how I see it though, is that we are in this stupid IE6 situation again, where people will be reluctant to upgrade to Firefox 5 and they will want to stay with their 'working' Firefox 4.  Oh dear.  Step back though, as the real reasons are more transparent than you might believe.  Chrome is making leaps and bounds at the moment.  Google are even pushing it though billboard and TV advertising at the moment which means that they are playing hardball.  Why would they want to support other browsers when they have their own product?  Development costs are another factor.  Google Labs has also this week been shut down, so some innovation and development has been lost there, but all that really is is cost cutting and putting all of their chips into more profitable products.

Clearly Google sees its future at the moment with products such as the lovely new Google +, which I think is a refreshing change to Facebook.  And why wouldn't they?  Take a look at Facebook right now and you can see why Google wants to get to the party.  I don't really blame Google to be honest, but you have to admit that it is definitely more of a discrete way of dictating browsing habits and testing loyalties.  Time will tell to see if this was actually a masterstroke or actually, they will reverse this decision and carry on with the toolbar or not.  Given enough pressure and demand, I don't see why they wouldn't carry on with it.

Speed up Your Website - Top Tips

Speeding up your site can often be the key to an enjoyable web browsing experience.  There is nothing more frustrating than waiting for your page elements to load.  This is really one of my pet hates.

What can you do about it?  The elements that basically slow your pages down are as follows:
  • Http requests within your page, i.e. loading an image;
  • Poor or invalid HTML markup;
  • Large images sizes;
  • Too many images;
  • Lots of DNS lookups;
  • Uncompressed JavaScript and CSS;
Having lots of http requests on your page is a real performance killer.  Having lots of external JavaScript files, images and CSS files will kill the performance of your site dead.  But what can you do about it?  Well actually the answers are more simple than you might think.

Your JavaScript and CSS can be easily compressed by removing much of the unnecessary whitespace within your code.  What I personally do, is keep a copy of the uncompressed original and when I want to make a change, I do so to that document and then compress it, making another new smaller file.  A great site that will compress your JavaScript for you is  Simply paste your code into a text box and it will spit your compressed code back out.

Images can also be combined into CSS sprites, which is essentially one image that can be used to style multiple elements from with your stylesheet.  For example, on my site I have one image that serves as a background for all of my h3 headings, main div headings and for the footer of my site.  This then only counts as just one http request, therefore massively decreasing the loading time for my site.  Have a quick Google around for this as there are many good sites that will give you some great examples.

Ok, so now you are left with a few things to do.  You are wondering how to make those big images smaller without having to sacrifice either the quality or the actual size of the image.  You've got several options.  One of them is to fiddle with the image format.  Personally, I prefer PNGs or JPGs for my images as they keep most of the quality.  Removing colours from the image is one way to also reduce your size.  Ok, now that you've done that, I bet that you are still wondering why your image size is large.  Next, have a go at using which is a little tool available from the Yahoo Developer Network.  The tool will compress your images for you, removing extra details such as the Meta information which really isn't important for your site. claims that it is a "lossless" tool, which means that it optimises the images without changing their visual quality.  Once the process has finished, the tool reports how many bytes that it has saved you, along with a zipped your shiny new smaller file.

Lastly, poor or invalid HTML markup is also a performance killer.  If you validate your code according to the HTML spec that you outline in your header, your site will load much more smoothly and quickly as your browser won't be trying to make assumptions as to what your code really should be doing.

Don't panic now.  There are a few tools out there that can help you.  I personally develop for Internet Explorer as that is where the market is.  I then test in other browsers such as Firefox, Opera, Chrome and Safari, and more importantly no longer for IE6.  But, when I'm in the process of quality testing and validation, I use Firefox along with the FirebugWeb Developer, HTML Validator and the YSlow plugins.  For me, these are the best tools available for you to test your site.  I advise anybody who is even vaguely interested in performance to check these out.  YSlow and Web Developer are both brilliant tools as you can fully inspect your markup, and YSlow will even grade your site based on your components.

As you can see from the image above, there are several options available to you in YSlow (also a Yahoo Developer Network tool).  Using the components tab, you can see every element in your site.  One minor point to note, Firebug needs to be installed to use YSlow.

Good luck!

Thursday, 21 July 2011

Two Useful Moodle Modules and Blocks

Wow, two posts in a day! Aren't you all lucky!

I've been looking through some of the best Moodle modules out there recently to add to our portfolio.  One area where I've always felt that we have lacked is on the video side of things.  Yes, the filters in Moodle can sort YouTube out no problem, but there isn't an easy way for you to add video in.

Step forward Media Player. The description mentions that it is the successor to the old FLV Player for deploying video within Moodle courses.  To be honest, there is enough of the necessary and basic functionality in there that you would expect, and it ticks all of the boxes.  It runs well, and I've not yet spotted any bugs with it.  I should imagine that the only stumbling blocks with this that users will encounter will be trying to work out whether or not they will be allowed to use the video as per the license terms and conditions, and also making sure that the video uploaded is less than the current max upload setting of 128mb that I impose.  I might consider upping this to 256mb, but I still don't see the broadband in this country being ready to handle large streams of data.

Then there is the other issue of our Internet connection to our site.  We currently have a 100mbit synchronous connection which will more than happily handle several streams outbound at any one time, as well as our normal web traffic.  Is this sustainable though?  I'm going to wait and see!  I might just throttle the site through IIS so that it doesn't impact on other services.

The other module is the Poll block.  Very simple, very effective and easy to use.  This is what I feel is the kind of thing that staff want to use to deliver a course.  It's also interactive, which generally translated means that students will also like it.

As you can see from the image above, it makes a nice little bar graph to help show the responses instantly.  I would recommend these two highly.

Network Level Control Through Your Website (and a Bit More)

Ok, network level control through your website.  Interested?  Good.

Last summer, a project of mine was to build a micro site which runs within the VLE that would give ordinary staff users access to network level functions that would normally be reserved for IT staff.  This project would be purpose built for our new student help desk, so that students could have a 'one stop shop' experience as we continuously dubbed it.  The key to this project would of course be ease of use.  We needed a solution that everybody could just pick up and run with from day one, and something that we would need to give very little support to.

The first hurdle would be to determine which services our students would need.  The new site would have to integrate with the following systems: -
  • Active Directory for network level and user management;
  • MIS system for course management, timetabling, exams and attendance;
  • Connect VLE (Moodle) for course management and job logging;
  • PaperCut print management for printing credit;

Next, we looked at the interface, and how we could make it as easy as possible for our staff to use the system.  A quick conclusion was that big, easy to use buttons, with minimal keyboard input and touch input would be the way forward.

The first screen that the user would need to see would be some sort of search facility.  This is just one big text box with some JavaScript on it to constantly give it some focus.  Users can input into this box into a variety of ways, including the traditional typing of random strings such as the username, first name, surname or a combination of these.  Once the search results are returned, a list is given back with possible results.  Each result shows the full name, username and picture of the student in question.  The user then clicks on the tab to take the user into the possible functions. The other method of input would be from the barcode scanner attached to the desk that would quickly scan the back of the student card that we give out at the start of each year that contains the username in barcode format.

Just so that we can confirm the user, the picture is printed on the card, and the same picture will appear on screen once the card has been scanned which points at a network share.

The user is then presented with four departmental options that are displayed as tiles, as well as a quick overview of the status of the student underneath.  This overview can quickly establish any problems, such as disabled accounts (and who disabled it), printing credit balance, and user data quota.  Clicking on any of the department tiles then gives another set of tiles that are specific to that particular department, i.e. in IT Services are functions such as 'enable / disable account', 'reset password' etc.  When clicking on any of these options, you can see instantly the status of the option, so say you've clicked on the 'enable / disable account', the tile will then show 'disable account' because the account is already enabled.  This is not too dissimilar to how Microsoft use the 'Live Tiles' implemented on Windows Phone 7, although I did it first for the record!

The next step was to make all of these functions.  The functions that we decided on were: -
  • Enable / disable account;
  • Unlock account;
  • Add to Moodle course;
  • Reset password;
  • Log new IT job (e.g. scanner not working);
  • Print student timetable;
  • Print exam timetable;
  • Attendance queries;
  • Order replacement student / bus cards;
  • Add printing credits via PaperCut API;
The network level functionality was achieved using both LDAP and SLDAP (for password reset) commands as well as network shares to link to student photographs.  Interaction with the PaperCut APIs made changing printing balances very easy with just one short command, and the other functionalities listed consisted of ODBC transactions to a set of different servers.

The site was locked down and would only be given to certain users based on permissions, as well as only being accessible internally to stop network intrusion.  The hardware that we ended up purchasing was a Dell Inspiron One machine with an attached barcode scanner to read in the student cards.  This has worked well, however we have found that most users have still preferred to use the traditional mouse and keyboard.

I hope that this will help somebody in some way, and I am happy to share any details on how certain parts of this were achieved.

Saturday, 4 June 2011

Internet Explorer 6 Given Another Kicking

Sorry that it has been a while since my last blog posting, I've had very little time of late to do as much of my own development on as I would have liked under normal circumstances.

Anyway, to my point. I woke up this morning and had a look through Google sci/tech news and came across a bunch of articles relating to the fact that Google have now finally dropped support for IE6, as I predicted that they would in my last blog entry. To be honest, it had to happen at some point anyway, but I really didn't think that Google would have done it so soon.

Great news though, as this may just be the tipping point where the estimated 11% according to Microsoft who still have IE6 can actually move on. My web stats put the figure at a far higher 20%. But well done Google! I bet all of the Microsoft sites still support it at the moment though! At work, I am currently in the site redesign process and I won't be giving it a second thought. In fact, I have my own Windows XP virtual machine that I use for testing sites with IE6 which I can now delete and have peace of mind.

The BBC have a fairly good article about Google dropping support and isn't a bad read.

What I do think is a little more dangerous is that there will be a loss of functionality for those who still use IE7, Firefox 3.5 and Safari 3. This could actually work against them, but hey they probably think that they are doing the right thing. The announcement by Google was made on their own blog.

This is all to push HTML 5, which will hopefully be the new standard in the not so distant future. So there you are, it is officially the start of the end!

Tuesday, 12 April 2011

Speed up the death of Internet Explorer 6 (IE6)

10 years ago, in a galaxy not so far away...a browser was born.

Alright, as dramatic as that wasn't, ten years ago Internet Explorer 6 came along and sat on pretty much every PC out there.  The reason for this wasn't that hard to understand really because there was little in the way of competition, and when Windows XP was launched this was the standard browser that came pre-installed.  The adoption of XP was massive and still is today, with many organisations out there still running the ageing system.  It had a massive market share of well over 95% and so other companies found it incredibly difficult to come close.  This Wikipedia entry for Internet Explorer 6 tells it all, and is actually great reading.

History lesson over then, or not.  IE6 had and still has massive flaws.  It's not secure.  It doesn't render pages well.  It doesn't do a proper box model.  It has very little in the way of standards support.  It's slow.  I will stop there because the list gets boring.  And yet, with all of the flaws, it still has about 10% of the browser share at the time of writing.  It's actually so bad, that even Microsoft wants to kill it.  Even though that site isn't fresh news, I still check back from time to time to celebrate the pending death of IE6.

At the time though as I mentioned before, IE6 had a goliath amount of market share.  The flaws weren't apparent then because there was nothing better to compare it to.  Microsoft obviously were so confident and thought that it was so good, that they actually gave up the development of the product entirely and killed their IE development team (not literally I hope).  In their eyes, it would have been the last ever iteration of the browser.  And yet, that didn't happen.

The rise of other browsers such as Firefox and Opera at this time caused Microsoft to have a bit of a rethink.  These were both better in every way, and had certain benefits such as tabbed browsing and better security.  Although other browsers such as Google Chrome and Safari (on Windows) came later on, these both did little to help the demise of the Internet Explorer brand.  Microsoft began work on IE7 and released several closed betas which were actually pretty good (I was part of these).  Suddenly, there was a massive movement by all of the browser boys to upgrade your web experience.

So anyway, back to my original point.  At this moment in time, IE6 has no future and is actually hindering my development more and more.  I think more and more that web developers should be encouraging the cull by just dropping support altogether.  I must admit, I hang on myself so that I wouldn't infuriate users, but now they are the minority.  IE7 will be the next to go in the not too distant future, but I believe that IE8 will be around for much longer due to Microsoft not willing to move IE9 to Windows XP (silly decision in my opinion!).  And that's it really.  It was more of an announcement on my part that IE6 is dead to me and I won't be spending any more time with it.

The next big range of problems exists with the new generation of browsers with what I previously have discussed - the various adoptions of CSS3 standards.  Also, browser optimisation for mobile platforms will be a massive area that everybody is at right now (including myself).  We'll see what the future holds very soon.

Oh, and on a final note, an early version of my new personal site will be launching soon called Soulfire Design that will be giving tutorials and best practice tips for anybody looking to start their own website, or make any improvements.  Please check out that link and if you are feeling generous please click on some of my ads!

Thursday, 17 March 2011

What to do with CSS3?

Recently, there has been a lot of activity on the CSS3 front.  W3C have only just released a new set of CSS3 specifications ( that will already change the level of support that the newer generation of browsers can offer.  The change fundamentally means that only updates to these new browsers will enable support for these new specifications.  There aren't any massive changes in there so there aren't any nasty surprises for those learning the new specifications.

These changes are great in terms of moving forward with standardised specifications, but also potentially harmful with the lack of support currently out there. Only a couple of days ago (15th March 2011), Microsoft released their latest and greatest weapon in the browser wars, Internet Explorer 9.   

The release of IE9 is a massive roll of the dice for Microsoft.  Microsoft has seen the market share for Internet Explorer slowly erode over the past few years with the continued efforts of the likes of Firefox, Chrome and Safari, all of which have had CSS3 support for quite some time now though.  By all means, none of these browsers are perfect, and all have their own small problems supporting the CSS3 specifications.  They aren't problems as such, more like, their own interpretations of the specifications.  Personally for me, this is potentially worse than the old 'IE box model' problems that plagued earlier versions of Internet Explorer.  What I really don't want to happen is for me to suddenly have to adopt several standards of the CSS3 specifications.  For example, to have rounded borders for an element, we have to look at the following:
  • border-radius (Real CSS3 / IE9 specification)
  • -moz-border-radius (Firefox specification)
  • -webkit-border-radius (Safari / Chrome specifiction)
So now we have the situation whereby if I want to go down the route of making my site work compltely with CSS3, I have to add all of the above just to get rounded borders without having the hassle of using images to make the rounded corners.

To be fair to Microsoft on this, they have correctly followed the specification laid out by W3C.  You never thought that you would see that did you?  Early reviews and personal testing have found that IE9 is a massive improvement in many aspects such as speed, security and usability.  I actually prefer this browser to any other now.  IE8 was too buggy and would eat memory like there was no tomorrow and Firefox would crash for no apparent reason.  I do like Safari, but things sometimes look a bit odd in it, as does in Chrome.  Saying this, Microsoft have done themselves no favours by restricting the platform for IE9 to Windows 7 - probably to encourage those who are still on XP to upgrade.

What I have done so far is give in to these horrible new varied specifications.  A new site that I am working on for myself employs all of the bulleted list above.  I believe that we are currently at the turning point for moving to CSS3, although HTML5 is further away I feel.  All of the latest browsers support CSS3 whilst support for the older browsers will suddenly start to slide.  From what I have read already, IE9 already has 2% of the market.  Not a bad achievement for a product released only two days ago.

Saturday, 5 March 2011

The return of Service Unavailable HTTP Error 503

For those of you that have read my first article in this blog, one of the reasons for the migration to a new server was because I was plagued with Service Unavailable HTTP Error 503, which would forever get under my skin and just 'error' for no real reason at all.  Nothing in the error logs, no software errors, nothing.  I was aware of the IMAP PHP module being faulty, whereby if the headers of an email were over a certain length, this would result in the 'Error 503'.  I could replicate this just fine, but the server would still fall over for no reason, even if I disabled the IMAP module.

This started on Server 2003r2 with IIS6.  Some time ago, after Googling around for a little while, I eventually found that other people experiencing the same issues with some people were saying this was down to a corrupt IIS configuration.  I had never experienced this before so it eventually started to turn into a bit of a headache trying to pin this down.  It had been on the cards for some time to move the server to a new box so for me to waste time reinstalling IIS was pointless.

Moving forward a year or so, and the problem had gradually been getting more frequent.  In the end, I just made a small VB Script as a workaround that would run every few hours to restart IIS in case this had happened which always cured the problem.  This had worked fine and my hope was that a planned server upgrade would solve this issue along with an updated version of PHP.  Wrong.  A few days into the new server being in production, what happens?  Yep, you got it.  Error 503.  Great.

Only this time there was a log entry in the Windows application log.  The shortened error looked like:
Faulting application name: w3wp.exe, Faulting module name: php_imap.dll
Google again came to the rescue, with the top result pointing at this PHP bug article about IMAP headers being too long - the same bug that was present before.  It looks as though the old problem had not been cured and it seemed that the only way to fix this would be to go up a major point release of PHP to PHP 5.3.5 (current release as of now).  ISAPI was always my favourite method for PHP use on Windows, but since this has now been retired as of the last branch of 5.2, FastCGI was now my only option.

FastCGI wasn't a problem though and it does work just as well as ISAPI although it does require a bit more of a tweak to get it set up out of the box.  So far so good though.  No more 503s.  I do think that originally the 503s were the result of the faulty IMAP module, but there still must have been a massive fault with IIS6 which is now now present in 7.5.

I would just like to say thanks to everybody who has been clicking on the sponsored adverts on this page.  It's very much appreciated.

Wednesday, 23 February 2011

Moving on, onwards and upwards!

Following on where I left off really from my last post!

I briefly mentioned in my last post that I had an upgrade path in place (after testing of course!) for 'Connect'.  The time was approaching to move on with the technology, whereby Connect had been in place for three years and in that time it had only ever had a couple of PHP / MySQL point release updates.  Not that this was a problem of course, but you can never be left standing still.

Anyway, after doing a bit of research and some testing on my machine at work I ended up drawing up a plan for the migration.  Not only would I be migrating the software from the old server to a new one, I would be taking advantage of certain in-house server developments.  Our new server cluster which runs Microsoft Hyper-V, has now been patched to SP1 by Microsoft to support dynamic memory - which means lots of nice resources for any server sitting within that cluster.  Not only this, I drew up plans to upgrade the core functionality of Moodle to version 1.9.10, as well as move to 64-bit MySQL and also move to the latest PHP 5.2.x release (I don't particularly like running Fast CGI on IIS as it has odd behaviour issues sometimes, which left me with ISAPI).

Testing of all of this was done successfully, very successfully!  With nearly everything running in native 64-bit mode on the server (except PHP), the performance boost was clear to be seen.  Pages instantly loaded quicker, reports were much faster to be dynamically generated and most of all, there would be peace of mind that it should, (famous last words!) be a lot more reliable and ready for the future.

To get started with the migration, one of our library server images of Server 2008 r2 was set up, and immediately patched with the freshly released Service Pack 1 from Microsoft.  MySQL, PHP and IIS were also set up, before copying the code across, setting security permissions and restoring the database from the old server.  The Moodle upgrade and module upgrades then took place, whilst downing the old server to ensure that there would only be one database in use.

And that was it really, how to migrate your Moodle!  Downtime was minimal, and first impressions are that everything seems very fast which I think in part is a little to do with everything.  The contributing factors in my opinion are:
  • (The obvious) Much more powerful server, with lots of resources
  • Move to 64-bit MySQL
  • New PHP release
  • Newer Moodle release
  • Move to Microsoft Server 2008 r2 SP1
I'll be adding more posts soon, so please follow this blog if it will help you in your day to day duties!

Monday, 14 February 2011

From the start...

Hi everybody, just to introduce myself and my blog firstly!

I'll start by saying that this isn't my first blog, but it is my first one for quite some time - about four years to be precise.  The reason for a re-start of my blog is to work more closely with other developers in the web development field, and hopefully to help anyone in need.

Next, I'll mention what by background is.  I've been a developer in education now for about six years now, and in that time I've worked closely on new ideas, more recently working and developing a highly customised version of Moodle, which has now been branded 'Connect'.

I've worked with various different languages on different operating systems using different databases, but most of my daily work and expertise involves Windows Server 2003r2/08r2, MySQL v5.x and PHP 5.x.  For me, I would say this is now my preferred environment after working with various different combinations of the above, and for many different reasons that I won't go into just now - but I'm sure that they will be apparent in the future as this blog develops.

The current, but soon to be retired server platform that I'm running is an old HP Proliant server, with the following specification:
  • Intel Xeon 3065 2.33Ghz processor
  • 4Gb DDR2 Memory
  • Microsoft Windows Server 2003r2
  • PHP 5.2.10 (Upgraded from 5.1.9)
  • MySQL 5.1.34 (Upgraded from 5.0.37)
  • Microsoft IIS 6
  • Moodle 1.9.0+
The server was originally bought to be a 'stop-gap' but has actually performed brilliantly during the time that it has been in service.  Personally, I believe that for 2000 users, the above specification is more than adequate.  What does let the server down especially, is IIS 6 which has increasingly become unreliable which, after doing some research, I believe is down to a corrupt IIS configuration.  Since there have been plans in the pipeline to migrate Connect to a Server 2008r2 environment for quite some time, I have left this alone for the time being.  Other than this, the server is extremely fast and has been very reliable with near enough 100% server uptime (excluding restarts for Windows updates).

Some of the posts that I will be writing shortly will be looking at:
  • Move of Connect to a new Windows Server 2008r2
  • Upgrading PHP 5.x
  • Possible up/downgrade of MySQL
  • IIS 6 deep rooted problems
  • Upgrading Moodle
  • Is Moodle 2.0 worth it?
The issues above are what I believe are current issues affecting my environment, and at some point I hope to have addressed all of the above.

Anyway - thanks for taking the time to read my blog, I hope that you have found this informative.  Please take the time to click on a sponsored link for me (even if you just open it and then close it!), and even follow this blog.