shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.91k stars 339 forks source link

Unexpected Installation of Additional PHP Extensions in php@8.3 Compared to php@8.2 #833

Closed theophileds closed 5 months ago

theophileds commented 5 months ago

Describe the bug When utilizing php@8.2 with the self-hosted runners configured with custom ubuntu-latest (22) images that mimic official GitHub hosted runners, an unexpected behavior is observed. Despite the documentation indicating a supposedly included list of extensions, many of them are not natively installed when using php@8.2 but are included in php@8.3. We noticed that php-setup installs 33 additional packages when transitioning from php@8.2 to php@8.3, while the documentation only suggest that pcov was removed.

Version

Runners

Operating systems ubuntu-22

PHP versions 8.2

To Reproduce

steps:
    - name: checkout
      uses: actions/checkout@v4

    - name: Setup PHP
      uses: shivammathur/setup-php@2.30.2
      with:
          php-version: '8.2'
          coverage: pcov
      # Required for self-hosted runners
      env:
          runner: self-hosted

    - name: list php modules
      run: php -m

Expected behavior Extensions pre-installed with PHP@8.2

[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcov
pcre
PDO
pdo_mysql
pdo_pgsql
pgsql
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache

Extensions pre-installed with PHP@8.3

[PHP Modules]
amqp
apcu
ast
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ds
enchant
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imagick
imap
intl
json
ldap
libxml
mbstring
memcache
memcached
mongodb
msgpack
mysqli
mysqlnd
odbc
openssl
pcntl
pcov
pcre
PDO
pdo_dblib
PDO_Firebird
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pdo_sqlsrv
pgsql
Phar
posix
pspell
random
readline
redis
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
sodium
SPL
sqlite3
sqlsrv
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlwriter
xsl
yaml
Zend OPcache
zip
zlib
zmq
[Zend Modules]
Zend OPcache
shivammathur commented 5 months ago

Those lists in the wiki are for GitHub hosted runners.

The builds used since PHP 8.3 are from shivammathur/php-builder, Till PHP 8.2 it uses builds from ppa:ondrej/php.

If you want more precise control over extensions, I would recommend using none as the first entry in the extensions input and specifying all the extensions you need following that.