4

On a Debian system, PHP extension binaries reside in /usr/lib/php/. Inside are folders for each PHP version, like 7.2 and 7.3, as well as folders named after dates, like 20170718 and 20180731.

Installing extensions using pecl install does not always add an .so file to each date folder. E.g. running pecl install jsmin created /usr/lib/php/20170718/jsmin.so but not /usr/lib/php/20180731/jsmin.so for me.

What do these dates represent?

2 Answers2

5

The dates are used to identify PHP API versions, and are encoded in main/php.h in the PHP source code. They are used as build identifiers for PHP extensions.

PHP API versions correspond to the following PHP releases:

API version PHP release
20170718 PHP 7.2
20180731 PHP 7.3
20190902 PHP 7.4
20200930 PHP 8.0
20210902 PHP 8.1
20220829 PHP 8.2
Stephen Kitt
  • 434,908
1

The dates in the folder names under /usr/lib/php/ represent the date when the PHP version was compiled and packaged for the specific distribution, in this case, Debian.

The .so files inside each folder are compiled for the specific PHP version and the specific date, and are used by the PHP installation on that date. It is possible that not all extensions have a version compiled for every PHP release, hence the missing .so files for some extensions.

AdminBee
  • 22,803
Ben
  • 31