What I’m reading in 2017

It’s fair to say I read a lot. I love books and always have a few stacked up next to my bed for a quick (or long) read before I fall off to sleep. I also love books for work, since although there is a huge amount of resources on the web, published books distill expert knowledge, are peer-reviewed and are a great way to get a good overview of a particular subject.

Continue reading “What I’m reading in 2017”

Viewing images on the command line and the “No identify available” error

I’ve been testing a website that generates images on the fly and in the past had used the less command to view the file contents, this helped see when PHP errors had unfortunately made their way into an image file.

However, sometimes when viewing a file I got the following error returned:

No identify available
Install ImageMagick or GraphicsMagick to browse images

I’m pretty sure I worked this one out a few years ago, but had obviously forgotten. Turns out you can’t view binary files via a command like less!

The right way to view an image file is a command such as xxd. To view the top of a file (which usually points in the direction of the file format) use a command such as:

xxd /path/to/file.jpg | head

This command works just as well for text files, so will still pick up if PHP errors are inside the image file instead of the correct binary data.

Saving this one for later so I don’t forget again!

PHP and me

PHP has just reached an incredible milestone, it’s 20 years old! On the 8th June, 1995, Rasmus Lerdorf released PHP 1.0. Now, 20 years later, PHP 7 is on the brink of being released and the language is stronger than its ever been before. With all the #20yearsofPHP stories around the internet I thought I’d add my own experiences and thoughts on how PHP has affected me.
Continue reading “PHP and me”