Skip to content

hint

How to upgrade a web host’s command-line PHP

The following is a very geeky, very niche1Where 'niche' is defined as 'of interest to maybe one person' tip, and I'm only documenting it here because it took me a while to figure it out, and I'd like to not have to go through that again if the need arises.

This site, and a few other personal projects, are hosted at Ionos, with whom I've been generally happy. On the web/GUI side, Ionos makes it really easy to control which version of PHP is used on your sites.

But I also have command line access to my server there, and I ran into an issue trying to run a PHP script (to upgrade another site). It threw an error, so I thought I'd check which version of PHP was in use…

$ which php
/usr/bin/php
$ /usr/bin/php --version
PHP 4.4.9 (cgi-fcgi) (built: Aug 29 2019 12:59:15)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

PHP 4.4.9 was discontinued in 2008—no wonder the script threw an error!

[continue reading…]



Yosemite: Dark Dock and App Switcher with light menu bar

High Sierra update: This trick no longer works in High Sierra. As far as I know, there is no workaround.

Here's my first (only?) Yosemite hint, courtesy of my Many Tricks partner, Peter Maurer. Peter wanted a light menu bar, but preferred the contrast given to application icons in the dark Dock—like this:

Here's how to achieve that effect.

  1. Open Terminal, then copy/paste this and press Return: defaults write NSGlobalDomain AppleInterfaceStyle Dark
  2. Paste or type killall Dock and press Return. The Dock will relaunch in its dark mode.
  3. Copy/paste this and press Return: defaults remove NSGlobalDomain AppleInterfaceStyle

The first step sets dark mode, step two restarts the Dock to switch it to dark mode, and step three turns off dark mode—but the Dock won't notice, and will remain in its dark state (until it's next restarted, which isn't often). Because the Command-Tab switcher is associated with the Dock, it will also be dark.

If you're going to script this, you'll want to insert a delay between the second and third steps, so that the Dock can finish launching before you disable dark mode. Neat trick!