Monday, 26 January 2015

Trying to build PHP for 3 days and binary comparing

Someone asked me about writing a wordpress plugin for them, and to do this I needed to rely on another wordpress plugin. Only problem was that the other plugin wouldn't run on my PHP installation as it required the gmp or bcmath extensions, neither of which my PHP installation included.

So I tried building the latest version of PHP, along with the latest versions of the libs the various extensions I need depend on. The first problem I had was that I couldn't get openldap to build. After looking into it, it seems that Oracle changed their licence terms for the newer versions of BerkleyDB and openldap is not 'compatible' with these licence terms. So it includes a check to make sure it won't work with the newer versions of BerkleyDB.

I couldn't see how to get openldap compiled without BerkleyDB, so I just gave up. I don't really need the ldap extension for PHP anyway.

After building all the needed dependencies, I tried building PHP, but got an error during compiling. I searched to see if anyone else had the same problem, and there didn't seem to be a solution. Just debugging advice - try and work out the minimum configure needed to reproduce the error, so you can see if it is a certain extension or two conflicting extensions causing the problem.

I then spent almost three days just trying to build PHP, changing some option, trying again, etc. in an effort to work out what the problem was.

The strange thing is, that when I started doing this, I got a different error relating to openssl, even if I was compiling with no other extensions specified in my configure line. Adding --disable-all to configure, I then managed to build with openssl. Gradually adding all the options back got me to the point where the original error message popped up again.

After many more build attempts I figured out the issue was my usage of the tidy-nu lib rather than the very old and outdated tidy. Changing this back to the old tidy and removing the --disable-all I was able to build okay. But that doesn't really make sense - what happened to the openssl error I was getting previously? Anyway, I guess finally getting it to build was the main thing.

Each build attempt takes at least half an hour before you see whether it was successful or not. This is why it took three days of changing the different configure options, rebuilding, then seeing if it worked or not before trying again with different options to narrow down the problem.

Today I was doing my morning backup as usual, but my backup drive was full. So I decided to re-organise my files a bit and move some to another drive. After moving the files I did a binary compare against one of the backups, and a few files were different. One was a Photoshop file, and one of the layers in the backup file had become corrupted. Another was a NEF (Nikon RAW file) that had become corrupted on the backup.

Two were large panoramas with many layers. I looked through the images, layer by layer, looking to see any evidence of corruption, both the backup copies and the originals. This took quite a while. However I couldn't see any problems. Since the other two images were both corrupted on the backups I decided to just copy the originals over the backups. The reason for doing this is just to avoid those files being flagged again in a binary compare in the future and me having to perform the same procedure.

With the files safely in their new location I backed them up to one of the disks I use for backing up the drive they are now located on. After doing that I ran a binary compare between the two drives. The new files had all copied okay, but there were a few corrupted files in other places, again, all on the backup. As well as images there were also some shortcuts that had become corrupted, and even a text file:

Thursday, 8 January 2015

Baking, checking, and fixing

Yesterday I was doing my monthly website stats checking, and also made some Eccles Cakes. I made the Eccles Cakes with grapefruit zest rather than lemon or orange, and I don't think they were as nice as normal.

As usual, my stats checking brought a number of issues to my attention, and so this morning (and yesterday evening) was spent looking into those issues and trying to fix them.

Tuesday, 6 January 2015

Gitting

Today I was trying to learn how to use Git. I started reading Sitepoint's Git Fundamentals ebook a week or so ago, then finished it off today. Unfortunately it was pretty useless and written for mac / linux users. E.g. discussing the head command it says to use HEAD^, but ^ is an escape character in Windows so you actually need to type HEAD^^.

I found a much better guide, which is free, here: Git Tutorial. This covers much more and explains the different commands better than the Sitepoint guide (though the section about branches seems to be in the wrong place). The Sitepoint guide doesn't really cover enough to start using git for real purposes, only enough for a very simple demonstration.

In the evening I set up git for one of my websites and started making some changes.

Thursday, 1 January 2015

Luminous Game Mouse Review

I thought I'd review my cheap mouse I bought from eBay because it has a good chinglish box. It was sold on eBay as 6 Buttons Adjustable USB Wired Optical Game Gaming PC Laptop Mouse Mice 1600 DPI.

As you can see from the box, it allows you to Easily control the infinite passion. I also really like the box design, with the rainbow coloured wordart at the bottom. Unfortunately you can't see it in the photo above, but under where it says USB in the bottom left corner, it tells you the interface is High-Speeounivwrsal Serial Bus. This is also repeated on the back of the box:

Regarding the actual mouse, it works fine. There are two minor issues. One is that I sometimes accidentally press the side button to go back a page when browsing the web. The other is that the constantly on blue light is a bit annoying. If I was buying again, I'd pay a bit more and go for a mouse without built-in lighting. (Seems stupid that you have to pay more to not have something).

(The light is actually quite a bit brighter than in the above photo in real life).

Anyway, as it arrived quickly (dispatched from the UK) and didn't cost much, I am pretty happy with it. My old mouse broke, so I didn't want to wait for a month for a cheaper / no lights model from China / Hong Kong.

Update 2016-10-24: A few months ago the left mouse button started to develop a problem, and this gradually got worse until I found the mouse too difficult to work with, and so got rid of it. The problem was mainly that when clicking and dragging the click would release half-way through the drag. The actual button didn't pop-up or anything weird like that, just the click would terminate part-way through the drag. Occasionally a standard left-click wouldn't register as well. So the mouse gave about a year and a half of decent use.