rickogden.com

Archive for the ‘Development’ Category

RIP Internet Explorer 6

The time I never thought I’d see is now on the horizon. The web moving away from supporting Internet Explorer 6.

Many web developers are all too aware of the pain of getting their websites working correctly in all web browsers and THEN having to make sure they work in IE6. This is not only inconvenient and irritating, but expensive. However, with Google announcing it is no longer supporting IE6 and now Amazon following their lead, it is appearing that very soon (not immediately) people will be forced to update/change their web browser to use these large and prominent websites. Many other sites have also dropped IE6 support (list at http://idroppedie6.com/).

Finally we will be able to spend our time on functionality rather than legacy support.

suPHP + Userdir on Ubuntu

Recently I’ve had the need to combine suPHP with the userdir mod for Apache on Ubuntu. By default they don’t play nice together. So here is a quick guide on how to get it working.

If you have installed a standard LAMP server (there are many guides on how to do this), you now need to install the suphp package for apache, this is called libapache2-mod-suphp:

$ sudo apt-get install libapache2-mod-suphp

Once that has been installed open the file /etc/suphp/suphp.conf in your favourite text editor. Find the line that has the docroot on, and change the docroot so that it is just “/”. This means that the suphp engine will parse anywhere in the file system, and not just in the standard html directory, thus allowing users to have their own.

docroot=/

You may also want to change the security options as appropriate, just change the “false” to “true” of the applicable ones the enable them. This is worth experimenting with. Further down you will want to set the “check_vhost_docroot” is set to false, this again is to do with the fact that userdirs are not in the vhost’s document root.

check_vhost_docroot=false

Finally you have the min_uid and min_gid properties. These are worth altering if you still want to be able to have a website running as www-data (such as the default website). If this is the case, change them both to the uid and gid of www-data (33 by default). It is not recommended to allow suphp to run as root, so do not set it to 0.

min_uid=33
min_gid=33

Finally, you need to enable the mods suphp and userdir, and disable the mod php5, this is done with two commands, and then restart apache2:

sudo a2dismod php5
sudo a2enmod userdir suphp
sudo /etc/init.d/apache2 restart

This should then allow you to run php scripts as the user who created them. To test this, create a new php file that contains:

<?php
system(id);

This will give you information of the user that the php process is running as. I recommend changing the ownership and retrying it, just make sure sure suphp is running as it should be.

Happy New Year and Updates

With it being the festive season, I have not done a huge amount of interest recently. I’m hoping to have a few things for you soon. Currently I have been experimenting with Drupal, having never used it (properly) before, this is a real learning curve.

Also I am working on getting suPHP to work with userdir, to allow users of a server to have their own webspace in a secure fashion. I will be blogging about this when it is done.

However, I have found a few things that may be of interest:
Things you probably didn’t know about PHP – Some really interesting and neat things you can do with PHP.

PHP Object Generator – Generates class structures and objects, so you don’t have to

(An Extended) Beginners Guide to Object Orientation in PHP

Those of you who were that the PHPNW09 conference on the Sunday morning may have seen my talk on Object Oriented PHP. At the beginning of the month I gave a talk at the PHPNW user group which was based on the original talk, but slightly extended.

Here are the slides

Talking at PHPNW – 1st December

Just to let you know that at the next PHPNW meeting I will be giving an extended version of my talk: Beginners Guide to Object Orientation in PHP, which I gave at the PHPNW09 conference.

For those who don’t know, this is held in Revolution on Deansgate Locks in Manchester, and starts at 7pm on Tuesday 1st December.

Upcoming link

Updated Ubuntu FreeNX Install Script

I’ve just updated the FreeNX install script to download and install the latest version of the NX Client from NoMachine. If you have used the previous version of this script, then you can just execute this version and it will automatically update your NX Client.

Download the latest version from here.

Zend_Auth Pam Adapter

A while ago for work I wrote a plugin for Zend Framework. It was an adapter for Zend_Auth that authenticated against PAM for authentication of local users through a web interface. So I have decided to release it in the hope that there will be other people out there who find it useful.

Please visit the Zend_Auth Pam Adapter page in the labs section for more information.

960 Grid System Tutorial

The more astute among you may have already spotted that I’ve uploaded a new tutorial to the talks/tutorials section. This talk is for 960 Grid System, a CSS Framework that is very easy and flexible.

Here is the tutorial.

PHPNW09 Conference

What a thoroughly enjoyable (and tiring) weekend I had at PHPNW09. Met many people from last conference/test fest, and many new people as well. On top of the drinking, socialising, networking, eating side of things, I actually saw some talks as well! So I thought I’d post a quick run down of who I saw.

The keynote speaker was Kevlin Henney who was a great speaker, talking about uncertainty when undertaking a project and when coding/debugging, and how to deal with these uncertainties. He was enthusiastic, interesting and kept the delegates engaged throughout! After the break was my good friend Lorna Mitchell giving a talk on the Joel test. Although I’d heard of the Joel test before, I hadn’t really looked into it, nor had I realised how it would apply to me (as a lone developer). Lorna soon set me straight with her talk.  Following her was Rowan Merewood from PlusNet talking on “Tools and Talent”. He was highly amusing throughout, certainly one of the funniest talks I have ever seen at a conference. Then lunch!

The catering was excellent, and we were all well fed and well up for more in the afternoon. Rob Allen kicked off the afternoon talks with his talk on the process that he goes through with his company when they get a project. This was one of the most insightful talks of the session, and it was fascinating to see how these things happen, and how it is all managed. After Rob was Derick Rethans who spoke about his php extension Xdebug. This was great as I have been using Xdebug for a while now, but I always wanted to learn how to use it better, and his talk definitely showed me how to get more out of this great debugger!

After some more refreshments I went to see Steve Richardson talking about the relatively new Yii framework. This looked very quick and easy to set up, however I think I will stick to Zend Framework as it seems more flexible and has a larger number of features. The last real talk of the day was by Scott MacVicar, who is always a laugh. He got badly heckled (which at this event was to be expected). Scott spoke about getting involved with various areas of the PHP project, from documentation through to core development. Finally for the Saturday was the closing session, and this featured a demonstration from Microsoft of Expression Studio. They took everything in good humour (this is Microsoft talking at an open-source conference) and even included Star Wars imperial force jokes. Their product looked very impressive (up until the point it stopped working), but I couldn’t help but feel they’ve completely over engineered something that is meant to be simple, rough and ready.

That was it for the main day talks, had another good meal then hit the bar for drinks courtesy of Sun Microsystems (although they were nowhere to be seen). Had a very enjoyable evening talking with some very interesting people from the PHP community, and then went home to try and sleep off the alcohol ready for my talk the day after. On the Sunday morning I saw Juliette Reinders Folmer giving a fascinating and insightful talk on UTF-8, and I learnt a lot about this format of text, and how it is the way of the future. Finally, we went off for more drinks (and food)!

On the whole a really enjoyable weekend, learnt many things and spoke to some great people. Thanks to everyone who was there!