If you install main release php8.1-dev package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2 amd64 Files for PHP8.1 module development
It works good:
# php-config --version
8.1.2
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1
If you install the security package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2.11 amd64 Files for PHP8.1 module development
It's not good:
# php-config --version
8.1.2-1ubuntu2.11
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1.2-1ubuntu2
I run this bug too. The sed regex is wrong:
If you install main release php8.1-dev package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2 amd64 Files for PHP8.1 module development
It works good:
# php-config --version
8.1.2
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1
If you install the security package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2.11 amd64 Files for PHP8.1 module development
It's not good:
# php-config --version
8.1.2-1ubuntu2.11
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1.2-1ubuntu2