PHP 7.2: Add Extension By Name

      No Comments on PHP 7.2: Add Extension By Name

I don’t know if you’ve been keeping up, but there’s not a lot of new coming down the pipe in PHP 7.2.  Yeah, there is a good list of things that are being deprecated, and a change to allow for type widening, but compared to PHP 7.0 and PHP 7.1, PHP 7.2 is positively a yawner. This makes writing articles about the new hotness coming down the pipe a bit difficult. Even so, there are a couple of things that are worth noting in PHP 7.2 One of them is “PHP RFC: Allow loading extensions by name”.

The way PHP handles loading extensions is absolutely fine, if you are a Linux system admin. Honestly, there was a time when most of us who managed PHP on a server were. The extension= lines in a php.ini require that you know the exact name of the extension. That name is different on Windows severs than on Linux servers. Even though the majority of PHP deployments are still on some variant of Unix, not all are.

So, to resolve this issue for the sake of the sanity of DevOps teams everywhere, PHP 7.2 will allow extensions to be loaded by name in addition to file name.

So now, all of these will be acceptable:

The last one being the proper file name on an HP-UX system.

This also means that there is one less difference between Windows and *nix php.ii files. Those of us who swap between the two will be greatly relieved.

 

About Cal Evans

Many moons ago, at the tender age of 14, Cal touched his first computer. (We're using the term "computer" loosely here, it was a TRS-80 Model 1) Since then his life has never been the same. He graduated from TRS-80s to Commodores and eventually to IBM PCs.   For the past 10 years, Cal has worked with PHP and MySQL on Linux OSX, and when necessary, Windows. He has built on a variety of projects ranging in size from simple web pages to multi-million dollar web applications. When not banging his head on his monitor, attempting a blood sacrifice to get a particular piece of code working, he enjoys building and managing development teams using his widely imitated but never patented management style of "management by wandering around". Cal is happily married to wife 1.33, the lovely and talented Kathy. Together they have 2 kids who were both bright enough not to pursue a career in IT. Cal blogs at http://blog.calevans.com and is the founder and host of Nomad PHP