PHP Notice: Undefined variable: _SERVER in ..

I upgraded Linux on this server a while back and in the course of that upgrade PHP was upgraded too, to version 5.5.9.

Since I had a modified php.ini it asked me to check over any new options. There were a few but I fixed anything that looked like it might break things. I saved the php.ini and let the upgrade go on.

Clearing up bugs

Some time later I saw odd notices in the PHP error log. Usually it referred to wp-comments-post.php but files outside of WordPress raised the warning too:

PHP Notice: Undefined variable: _SERVER in ..

It turns out the fix is rather easy. Jacques Marneweck on his blog posted a solution. Simply switch off “auto_globals_jit” in your php.ini and restart Apache (if required).

From the PHP manual entry for auto_globals_jit:

When enabled, the SERVER and ENV variables are created when they’re first used (Just In Time) instead of when the script starts. If these variables are not used within a script, having this directive on will result in a performance gain.

The PHP directives register_globals, register_long_arrays, and register_argc_argv must be disabled for this directive to have any affect. Since PHP 5.1.3 it is not necessary to have register_argc_argv disabled.

A bug

It looks like the bug is ancient although I’m not using APC, and the JIT compiler can be fooled if you access the super globals like _SERVER through variable variables. Sneaky!

The default for auto_globals_jit is “On” so next time you upgrade PHP keep an eye on the error log.

B/W HDR Look in Lightroom

Anthony Morganti uses an interesting technique to create photos with a black and white HDR look in Lightroom. It can transform a photo so it looks something like this. (I added a vignette as well.)

B/W HDR Look 1

B/W HDR Look 2

It doesn’t suit all photos of course, it’s also only a starting point as you should develop your photos in whatever way you desire. To avoid repeating all those steps every time I created a Lightroom preset.
Grab that file and install it in the same way you’d install any Lightroom preset. What d’you think?

Restoring From Physical Media

dancing in the street

Remember DVDs? Last night while looking for the original photo of this dancing in the street photo I was horrified to find an empty directory!

Empty Directories

I had no idea when they were deleted. I searched my backups but of course the directories had been synced a long time ago and they were gone. I checked Backblaze and there was no sign of them. I even checked Google Plus for their backups but still no sign of them. I must have deleted them more than two years ago.

I hate that. I have multiple copies of every photo just because this might happen and yet it wasn’t enough! My backups sync every night so any deletes were synced within twenty four hours.

Almost. Later, I remembered that I had backed up photos to DVDs before I started using multiple drives and Backblaze. They were up in the attic!


It didn’t take long to get them, the first DVD worked and my photos from The St. Patrick’s Festival in 2006 were restored, but the photos from April 20th were on the second DVD. The second DVD didn’t work. Nooooo!

The rest of the photos did survive their stay in my cold, damp attic and were restored. I’m thinking now about monthly offline backups to a drive I’ll plug in occasionally.

Do I have any photos from April 20th, 2006? I remember the day well because I was in St. Finbarr’s Hospital with my wife helping a family member. While the others waited I went outside to take photos of a derelict building at the back of the hospital grounds. People passed me going to work while I was take pictures of the daisies, flowers and old architecture. Soon enough a security guard showed up but he just asked me to stop taking photos. I do have a few photos. We called to a friend later in the day and I got some shots of her cat so that’s here too. :)

What’s the take home message from all this?

  • You can never have too many backups.
  • You need versioned backups (of a few days at least) in case you notice a mistake a few days later after your backups have been synced.
  • You need an offline backup that’s synced periodically.
  • You need cloud backup that will keep your files safe for a length of time after they’re deleted. Backblaze holds on to your files for thirty days after they’re deleted!
  • When you export files from Lightroom, Photoshop or whatever graphics app you use, always make sure you export a full size original version, not just a web version.

I’m sad that those files are gone, but glad I have a few reminders of an eventful day.

Raw DNG Samples from the Nexus 5

Android L, the next major release of Android will allow apps to get raw data from the camera. This lets photographers extract more information and develop photos a lot more than they could with simple Jpeg files. They’ll be able to “push” the image further to recover blown out highlights and recover detail from shadows.

At least that’s the theory. You’re still working with the relatively small lenses and sensors in camera phones so they’re not going to compare to a DSLR or dedicated camera but images will get closer in quality.

This thread on r/Android has some samples of DNG files you can work on in Lightroom or whatever your RAW processor of choice is. The photos were taken with lcamera as the official Google camera app only records to Jpeg images. I took a stab at the “auto exposure” image here and came up with this:


That’s pretty good for a photo taken by a Nexus 5 at ISO 1635. Lightroom settings were as follows:


  • Temp: -1.65
  • Tint: +59
  • Exposure: -1.65
  • Highlights: -100
  • Shadows: 100
  • Whites: +2
  • Blacks: -29
  • Clarity: +22


  • Sharpening
    • Amount: 67
    • Radius: 1.0
    • Detail: 10
    • Masking: 70
  • Noise Reduction
    • Luminance: 20
    • Detail: 50
    • Contrast: 0

I’m really excited to see what Android L will bring to camera apps once it’s officially out in the wild and more phones have it installed!

Photos from Helios XM Anomaly in Dublin

Last weekend I took the train to Dublin to take part in my first Ingress event, the Helio XM Anomaly. All I knew was that both Resistance and Enlightened would be there fighting over portals but not much more than that.

Fights for portals were intense 15 minute battles. It must have made a strange sight watching two groups of adults bent over their phones on a street or park tapping at their phones. The only thing heard were the frequent shouts calling “DEPLOY”, “MOD” or “CUBE” as we shouted what we were doing. Who won? The Resistance of course!

The next (closest) Helios event is in Manchester but if there’s another one in Ireland I’d like to go if I can. Good fun, lots of walking.

Almost 23,000 steps around Dublin

Retro Gaming at jQuery UK 2013

Just a few photos that have been sitting in my “upload folder” for the last year or so after attending jQuery UK. Look at all those old 90s consoles! Snes and Megadrive machines? There’s another machine there too but I don’t recognise it. I wasn’t a fan of console gaming back then, but if they’d thrown in a C64 I’d have had fun!

It was an amazing conference and best of all, the talks are online. I remember being blown away by Wait, Chrome DevTools can do THAT? by Ilya Grigorick.

Scenic photos of Oxford will eventually make their way to my photoblog at In Photos dot Org.

The loss of a dog


Some of you, particularly those who think they have recently lost a dog to “death”, don’t really understand this. I’ve had no desire to explain, but won’t be around forever and must.
Dogs never die. They don’t know how to. They get tired, and very old, and their bones hurt. Of course they don’t die. If they did they would not want to always go for a walk, even long after their old bones say:” No, no, not a good idea. Let’s not go for a walk.” Nope, dogs always want to go for a walk. They might get one step before their aging tendons collapse them into a heap on the floor, but that’s what dogs are. They walk.
It’s not that they dislike your company. On the contrary, a walk with you is all there is. Their boss, and the cacaphonic symphony of odor that the world is. Cat poop, another dog’s mark, a rotting chicken bone ( exultation), and you. That’s what makes their world perfect, and in a perfect world death has no place.
However, dogs get very very sleepy. That’s the thing, you see. They don’t teach you that at the fancy university where they explain about quarks, gluons, and Keynesian economics. They know so much they forget that dogs never die. It’s a shame, really. Dogs have so much to offer and people just talk a lot.
When you think your dog has died, it has just fallen asleep in your heart. And by the way, it is wagging it’s tail madly, you see, and that’s why your chest hurts so much and you cry all the time. Who would not cry with a happy dog wagging its tail in their chest. Ouch! Wap wap wap wap wap, that hurts. But they only wag when they wake up. That’s when they say: “Thanks Boss! Thanks for a warm place to sleep and always next to your heart, the best place.”
When they first fall asleep, they wake up all the time, and that’s why, of course, you cry all the time. Wap, wap, wap. After a while they sleep more. (remember, a dog while is not a human while. You take your dog for walk, it’s a day full of adventure in an hour. Then you come home and it’s a week, well one of your days, but a week, really, before the dog gets another walk. No WONDER they love walks.)
Anyway, like I was saying, they fall asleep in your heart, and when they wake up, they wag their tail. After a few dog years, they sleep for longer naps, and you would too. They were a GOOD DOG all their life, and you both know it. It gets tiring being a good dog all the time, particularly when you get old and your bones hurt and you fall on your face and don’t want to go outside to pee when it is raining but do anyway, because you are a good dog. So understand, after they have been sleeping in your heart, they will sleep longer and longer.
But don’t get fooled. They are not “dead.” There’s no such thing, really. They are sleeping in your heart, and they will wake up, usually when you’re not expecting it. It’s just who they are.
I feel sorry for people who don’t have dogs sleeping in their heart. You’ve missed so much. Excuse me, I have to go cry now.

I realise the entirety of this post is copied from elsewhere but I have nothing else to add. From this Reddit comment but I think this post is the original source.

The source is a friend of mine, whom I asked if I could share it after he posted it on facebook. I share it because I think it is beautiful and helps those who have lost a pet.

Edit: Spring, the dog pictured above, was our family dog growing up but she died 11 years ago leaving a huge gap in our daily lives. As with any death, time is a healer but it never fully mends.