The Northern Spy
by
Rick Sutcliffe
August 2025
Adventures in PHP
|
|
The Spy's LAMP server exploded
last week with messages from its CRON every five minutes 24-7 complaining about the ionCube loader needing to be installed, though not saying why. Well, yes it was installed, but the Spy uses WHMCS as his help desk and billing system for selling domains and hosting from his LAMP server, and apparently versions of that program beyond 8.5 now required PHP 7.4 or 8.1, the latter preferred because the former is pretty dated. Why this issue appeared to appear suddenly even though his last update of WHMCS was some months ago, and he has made no recent PHP changes, is unknown. The nature of the actual problem took quite a while to pin down and knowing the reason required some assistance from the data centre to find the right rabbit trail down to repair wonderland, so it's worth consolidating what he found here for the benefit of other techies of a similar bent and issue. Call it the thirteen steps of PHPness.
First If using an MS(erver) instead, this will not necessarily be applicable, so chill. We don't all have the same tech issues with which to deal. Many data centres only allow LAMP servers on the premises anyway, but that's a side issue.
Second Before proceeding, you must be at least at WHMCS version 8.6 if using that software. For other software that might be having ionCube loader indigestion, your kilometreage my vary. (Canadians, like all but two countries in the entire world, don't have "miles" any more.) So if not, upgrade WHMCS to at least that level first. When you do, it may or may not be functional. Don't worry about that. Keep going. It should be by the end.
Third Sign on to WHM (not just CPanel) so you can update system files. Go to Easy Apache 4 and click on "Customize" in the box where it says "Currently Installed Packages."
Fourth Click first on "PHP Versions" in the left column. The resulting screen shows only its first 10 items so you may need to go to the next page--both here, and throughout the process. Click the installer for at least PHP version 8.1, and if you want, for 8.2 and 8.3 as well.
Fifth Either click "Next" at the bottom of the page or "PHP Extensions" in the left column. Both continue at the same place. Use the search box here by entering the php version number(s) you have just told it to install and click whatever extensions you need, specifically including at least ionCube 12 for php 8.1 and ionCube 13 for higher numbered phps. The Spy installed ionCube 12 for php 8.1 as that is what WHMCS asked for. v13 may work too, but you can only install one such loader per php version, and if you change it, the previous one will be uninstalled. One upgrade at a time. Assuming that you want to be able set a default php for all new accounts, ensure you install php-fpm for each php version you decide to load. Click beside any other PHP-specific items that were already installed for your last working version.
Sixth You may skip the Ruby section, unless you have unrelated modifications there. The Spy does not, however, advise changing things unrelated to the project on which you are currently working, so yes, skip to "Additional Packages" using the left column. You can make more changes another day when you are sure these ones work
Seventh Here, you want to make a list of what extensions you have activated beyond the default, in the last php you had installed, then go through the corresponding new version(s) you are installing, and click all those. Presumably you installed them for a reason (you or some customer wanted them, but perhaps you don't remember why.)
Eighth Following your next "Next" you get a chance to review your choices. If all seems OK, click "Provision," and wait a bit. You should after a few seconds get a message saying the provision is complete. If you spot a mistake, you can revisit sections and re-edit your choices without losing others you have picked, and then return to the last page and hit "provision".
Ninth You should now go to WHM: MultiPHP INI Editor. Check your previous PHP version there and see if you changed any of its default settings. Again, presumably you had a reason. Apply those same changes to the new version(s). If you want to set a default php for new all accounts, enable php-fpm here.
Tenth You Should now go to WHM: MultiPHP INI Manager. Choose "System Settings" first, if it does not pick that automatically on entry. This is where you tell new accounts what the default php handler is. If you are really picky and want to force everyone to a specific version, go ahead, though this may break their code and generate complaints. If you want to set a default php for all new accounts, and assuming you provisioned it, you may also enable php-fpm here. Individual accounts under CPanel can make changes to their handler themselves. However, if using WHMCS, you certainly need to change its handler. You can do the latter either in its own CPanel, like anyone else, or remaining in WHM MultiPHP Manager, click on "User Domain Settings" and scroll down to the account using WHMCS, where you can switch it to the recommended PHP (Don't choose "inherit" as the day may come when you move the system to a higher default version that WHMCS would inherit but perhaps could not yet use.
Eleventh Check to make sure WHMCS is in fact working (and you haven't missed anything). Wait a few days before updating WHMCS to any higher version than you already had functioning, but check at their site to ensure it does not require anything else, such as an even later version of PHP or ionCube.
Twelfth (may not apply; situations may vary). A day after all this, a customer complained that no e-mail was reaching him. The Spy investigated using one of the mail queue utilities. (WHM has one, ConfigServer has another.) Thousands of emails had been queued, and forcing the queue did nothing, but complained of missing files. Hours of research later, the Spy learned to do this: He went to ConfigServer Explorer and used its command line (rather than take extra time to ssh in as root) and typed the following command to rebuild the queue:
/usr/msfe/msreq.pl
After waiting for it to finish, he returned to the queue manager and again tried forcing a queue run (though this may not have been necessary). This worked. It took quite some time, but the Spy assisted by intervening to delete obvious spam in order to reduce the queue size by a few thousand. Eventually all became copasetic.
Thirteenth Go back and thank anyone who provided clues that put you on the right track, and tell them about anything new that you discovered, so they can update their own advice. Spread the word.
Hmmm, that triggers
another item like those offered last month. Suppose a compiler front end takes as input an expression like: "sum = sine (theta) + tangent (phi)" and builds a parse tree for it. What has it then created to pass to the back end? Answer: a pair trig in a parse tree. Groans are appreciated.
On a completely different tech level
the Spy is renovating turning a bare home basement storage room into an office, as his current one is an odd shape and less functional than it should be. It may in turn become a game-and-puzzle room for the grandchildren. This project first eventuated some trips to the dump and recycling centre, a giveaway or two, a creation of some firewood, and a relocation of things worth keeping to a much smaller basement area, in order to remove thirty-three years of accumulated clutter.
Once he put up the first layer of insulation (foam against the cement walls) and did the framing, he had a lot of wiring to do, as the entire room boasted only two light bulbs and a single plug outlet. After all, his office setup uses mucho juice, especially after the frequent power failures in the neighbourhood around his igloo (including two in one day!). He's done lots of this sort of work in the past, and knows how it's done, which always seems to surprise the government safety inspectors. Although, considering some of the homeowner wire jobs (and even contractor ones) he's seen, perhaps their surprise should not be too surprising.
In the past, multiple wire joins in a typical box were effected by stripping some insulation, twisting their bare ends together, and screwing on a wire nut. These plastic caps have a tensioned hollow spring inside to compress and hide the bare wires to solidify the connection and prevent shorts (and therefore fires.)
However, for his birthday, his elder son had given him something relatively new in the field--a package of assorted Wago lever connectors (German, so rendered "Vahgo"). After ensuring these were CSA-UL approved, and double checking that the Provincial electrical code permitted them, he used them throughout the new project. They take a little getting used to, but once he was in a rhythm and cut the wires to an appropriate length, the whole thing went well. They are faster, take no more room in the box than wire nuts, and seem solid. After opening a lever, one must ensure each wire is inserted all the way into the receiving slot (and not over-strip it to ensure no bare wire ends up protruding from the device) before closing the lever, then test it afterwards by giving each wire a tug and ensuring it cannot pull out.
These nuts can be purchased in same-item packets or assortments of various sizes on Amazon, from international electrical/electronic supply giant Digikey, or if you are a contractor, in bulk packages by the thousands from your local wholesale electrical supply firm. They come in devices for 2, 3, and 5 wire side-by-side connections, plus a two-conductor pass-through version. Make sure you buy models rated for the wire size you are using. The most common models allow sizes from numbers eighteen up to twelve solid or stranded wires. Other models can also take smaller sizes.
The Spy's only minor beef is that there isn't a four-conductor version of the connector, as he had several boxes in which those would have saved a bit of space, but this isn't a particularly big issue.
He has, however, seen warnings about fakes, so do be cautious about buying the real thing from reputable sources. Other genuine brands may also work well, but do your homework and ensure what you get is legitimate and itself CSA-UL approved. If in doubt contact your local inspection authority. Oh, and do get a permit for your work and actually have it inspected. It costs more than the Spy thinks reasonable here in BC, but if you don't, goof, and cause a fire, you may find yourself without insurance.
OTOH, the worst decision the Spy made when building his current house in the first place was allowing the foreman he hired (and regretted doing so afterward) to hire an electrical contractor for the rough wiring, instead of doing it personally, as he should have, rather than assuming their people knew what they were doing. The company may have used not-well-supervised apprentices to do the work, for there were numerous mistakes made, including too many items on one key circuit (breaker overload) and a dead short that did cause flames to shoot out of a box in the garage as soon as the power was switched on. Fortunately there were no combustibles close by and the Spy knew how to fix it right.
Amusingly, when final inspection time did come once the Spy had finished all the switch and plug installs, the first thing to said visitor's hand was his polarity checker. The Spy held out the identical item and offered: "Want to use mine?" He replied, somewhat in astonishment "Oh, you know what you're doing." Yes, most of the time, the Spy hopes so. We shall see when the next inspector comes
And BTW,
when the Spy re-provisioned his electronics course lab for this Fall's nearly double the largest previous number of students, he bought most of the supplies from that same Digikey Canada supplier mentioned above. There is very little in electrical or electronics gear they do not fully stock in single items through to bulk packaging. 'Course, since some of that material comes from or via the USA, those prices are set to rise dramatically. Sorry, MAGA is simply wrong on this file too. Tariffs are simply a tax grab paid initially by the importer, but ultimately by the end purchaser, but certainly not by the exporting country.
It takes time (months to sometimes a couple of years) for the full consequences of new taxes (including tariffs) to be met, because although money transfer effects are now friction-free, goods orders and shipments that fuel the supply chain are certainly not, as they are buffered by warehouse inventories and items in shipment but not yet charged the import tax. Ultimately said inventories are re-stocked by goods that cost their importers more. They cannot simply absorb the penalty tare and also stay in business. Neither can their corporate stock market valuations remain at current historic highs in such uncertain and unprofitable times. Profits will decline; prices will rise; stock markets and whole economies world wide will slowly grind to a near halt. Yes, tariffs do reduce imports, but they do so by making goods (much) less affordable in the importing country, so people either won't buy or can't buy. The exporting country has little choice but to retaliate with tariffs or export taxes of its own. Slowly but surely, the collective world economy begins to shrink as the trade war escalates.
Question: What did the same kind of trade tariff wars started in the same way cause a century ago? Answer: The only "great" about that outcome was the Great Depression. Why have politicians not learned from history?
Well, once more it is QES (quite enough said) for another month. See you when the new semester and the wet coast's rainy season are about to start. The Spy's students haven't just yet told the Dean to "Throw the bum out" in their course-ending surveys, so he will continue (he supposes) to impart knowledge, some skills, and perhaps in some cases, even wisdom. Mind you, the buzz about the computing science job market is pretty negative these days in the face of (a) economic uncertainties, and (b) fears about how many human jobs AI will cancel. The Spy's reply: to (a) uncertainty causes more economic grief than outright bad news, so quite a few jobs will shrink away in the next few years, but to (b) in the longer run, far more job loses outside computing than within it. We're facing a major economic reorganization as the rate of change accelerates.
--The Northern Spy
Opinions expressed here are entirely the author's own, and no endorsement is implied by any community or organization to which he may be attached. Rick Sutcliffe (a.k.a. The Northern Spy) is Professor of Computing Science and Mathematics and Assistant Dean of Science at Canada's Trinity Western University. He completed his fifty-fifth year as a high school and university teacher in 2025. He has been involved as a member of or consultant with the boards of several commercial, nonprofit, and/or educational organizations and participated in developing industry standards both nationally and internationally. He is a long-time technology author and has written two textbooks and ten alternate history SF novels, one named the best ePublished SF novel for 2003. His various columns have appeared in numerous magazines and newspapers (both dead tree and online formats) since the early 1980s, and he's been a regular participant and speaker at churches, schools, and academic meetings and conferences. He is a half century-long member of the IEEE, ACM, and MAA. He and his wife Joyce celebrated their fiftieth anniversary in 2019 and lived in the Langley/Aldergrove/Bradner area of B.C. from 1969 to 2021 when cancer happened, so he latterly continues alone, depending heavily on family and friends to manage.
URL s for Rick Sutcliffe's Arjay Enterprises:
The Northern Spy Home Page: https://www.TheNorthernSpy.com
opundo : https://opundo.com
Sheaves Christian Resources : https://sheaves.org
WebNameHost : https://www.WebNameHost.net
WebNameSource : https://www.WebNameSource.net
nameman : https://nameman.net
General URLs for Rick Sutcliffe's Books:
Author Site: https://www.arjay.ca
TechEthics Site (Fourth edition of text; the fifth has been released; site redesigned.) : https://www.arjaybooks.com/EthTech/index.htm
Publisher's Site: https://www.writers-exchange.com/Richard-Sutcliffe.html
URLs for the newest edition of Issues Text:
Wipf&Stock site for his 4Civ textbook Volume One: https://wipfandstock.com/9798385226818/the-fourth-civilization-volume-one/
Wipf&Stock site for his 4Civ textbook Volume Two: https://wipfandstock.com/9798385232932/the-fourth-civilization-volume-two/
URLs for products and suppliers mentioned here:
Digikey Canada (but offices in many countries) : https://www.digikey.ca/en/products
|