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!