Friday, 5 August 2011

Tech tip #1 : using .htaccess instead of php.ini

I've decided to put a few notes here that related to my new (at the time of writing) job.
I find that you normally learn all kinds of useful stuff when you start a new job, but I often forget to document it.

If I'm lucky I'll remember to bookmark the place where I discovered my new knowledge so I can find it again, or if not I'll have to google it and hope that the same links come up.

This time I've decided to add a few posts here.

So - yesterday I needed to increase the memory limit and maximum execution time for a particular php script after getting a support email from a user. Updating the code with ini_set() or set_time_limit() wasn't an option, as they try to keep code modifications to a minimum here, to ease future upgrades.

Normally I'd head over to edit the php.ini file to edit memory_limit and max_execution_time and reload or restart apache, but in this new job I'm very much a developer rather than a sysadmin. This means that I don't have access to config files, nor the permissions to mess about with the apache daemon.

So - I had to go down another route that was new to me : using .haccess.

It turns out it's really simple to do this, just add the desired values in the .htaccess file for these two values. After checking with the sysadmin that I wasn't going to break his server I was able to add :

php_value memory_limit 360M
php_value max_execution_time 180

Problem solved, user happy, back to real work. 

Sunday, 20 February 2011

Edward Not Edward

Today I ripped an LP.

That's a vinyl album.

This one was from 1989, a compilation of songs written by a guy called Edward Barton, performed by various bands that were knocking about the underground at the time.




We've got the Inspiral Carpets (although not the singer you'd remember from their hits), Stump, Dub Sex, 808 State, A Guy Called Gerald, The Fatima Mansions.


I remember seeing Edward Barton on the TV, the Tube, when I was a kid. This is a video of his appearance on there :




I don't remember that particular song : the one I remember is called 'Me and My Mini', which is covered on the LP by someone called Patrick Mooney. No idea who he is.

That performance stuck in my head for years, until I saw 'Edward Not Edward' in the racks of my local record shop and bought it on a whim. 

Edward Barton's lyrics are fascinating : nonsense, moving. He's clearly got a unique view of the world.

Me and My Mini