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!