Operating System and Web Server

Server APIs (SAPIs)

One of the big advantages of PHP has always been its availability on a multitude of web servers. In former times, PHP was mostly used together with the Apache web server as part of the so-called LAMP stack. The part of PHP that integrates it with a web server is called the Server API (SAPI).

Over the years, more and more users switched to integrating PHP and the web server using the FastCGI protocol. The main reason is that tightly integrating PHP with the web server by loading the PHP binary into every web server process is rather heavy-weight. PHP is not required to serve static content. Nowadays, PHP-FPM, which is part of PHP, should be used to build a pool of PHP processes that runs (or can run) on a separate machine than the web server.

Since most of the Server APIs that PHP 5 supported were being used less and less, the support for a number of them has been removed in PHP 7:

If you are still using an Apache web server, don’t worry about the SAPIs mentioned above. apache refers to version 1 of Apache HTTPD, which has been unsupported for more than a decade.

The hooks and filters allow find-grained control over how Apache HTTPD delivers content. Since we have never seen anybody use them, and could not find any substantial information about them used in from or with PHP, we assume that nobody will miss them.

Actually, almost all other web servers mentioned above have never been stable, or are unmaintained today. If you are missing out on any specific SAPI in PHP 7, you should just switch to FastGCI and PHP-FPM.

Support for Outdated Windows Versions

Microsoft released Windows Server 2008 R2 as well as its desktop counterpart Windows 7 in July 2009. Mainstream support for both versions already ended in January 2015.

Windows Server 2008 R2 and Windows 7 are still supported by PHP 7. However, older versions of Windows are no longer supported as of PHP 7.2.

Support for NetWare

The final update of the computer network operating system NetWare was released in May 2009. Nobody working on PHP has access to a NetWare installation so PHP on NetWare has not been tested for years.

In light of this, the PHP developers have decided to remove support for NetWare from PHP 7.2.

Dynamic Extension Loading in PHP-FPM

The dynamic loading of PHP extensions at script runtime is a feature that rarely anybody uses in the wild. To understand this feature, we have to look into some technical details of PHP. The PHP language itself is rather small, and can be easily extended through so-called PHP extensions. These extensions can be statically compiled into PHP, thus becoming one binary. In this case, PHP cannot be run without this extension.

PHP extensions can also be compiled as separate binaries, .so files on Unix, or .dll files on Windows. In this case, they can selectively be loaded by specifying a php.ini directive like so:

extension=some.so

Breaking down PHP into a relatively small language core and multiple extensions is useful because everybody can build their own PHP, leaving out code that is not required. The package managers that most modern operating systems have (apt, dnf, yum, and the likes) allow for a great deal of flexibility by simply installing additional PHP extensions with just one command line call.

PHP has a built-in function dl() that loads an extension at runtime. This is not possible if PHP runs multi-threaded. Imagine one thread loading an extension, which suddenly makes new PHP functions available half-way through another thread. Or worse: an extension might modify PHP’s behavior. Do this half-way through a thread, and you will end up with weird behavior that you will never be able to reproduce.

In PHP 7, dl() has been disabled for PHP-FPM, because one process in FastCGI also serves multiple requests. Thus, dynamically loading an extension does not make sense, because this extension would also be available to other scripts that do not need it, or worse, try to dynamically load another extension that conflicts with a previously loaded one.

Dynamic loading of extensions is still possible in the CLI interpreter. However, we strongly suggest not to use dl() at all. Run different configurations of PHP off of different php.ini files. You can do this either at the command line, or in FPM, by configuring different FPM pools.