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.89k stars 337 forks source link

Allow to use any php extension, ex support sqlsrv extension for Windows and php 8.2 #758

Closed Max84 closed 12 months ago

Max84 commented 1 year ago

Describe the feature We can install any php extension, even onto PECL, but only if a DLL exists. For example, it doesn't possible to use the sqlsrv extension on Windows if we use php 8.2 because the DLL doesn't exist onto PECL website. But Microsoft already provides this DLL. A good feature can be to allow us to use any DLL, even it's not a PECL DLL.

Version

Underlying issue N/A

Describe alternatives N/A

Additional context N/A

Are you willing to submit a PR? I'm not really fluent with TS :(

Max84 commented 1 year ago

If it can help, these is a way to get the extension:

`- uses: shivammathur/setup-php@v2 with: php-version: '8.2.9' extensions: curl,fileinfo,gd,gettext,gmp,imap,mbstring,mysqli,odbc,openssl,pdo_sqlite,pgsql,soap,sockets,sodium,sqlite3,tidy,xsl,zip,php_com_dotnet,bz2

  - name: Install Custom Extension
    run: |
      mkdir extensions
      Invoke-WebRequest -Uri https://github.com/microsoft/msphpsql/releases/download/v5.11.0/Windows-8.2.zip -OutFile extensions\sqlsrv.zip
      Expand-Archive -Path extensions\sqlsrv.zip -DestinationPath extensions

  - name: Configure PHP with Custom Extension
    run: |           
        cp extensions\Windows-8.2\x64\php_sqlsrv_82_nts.dll C:\tools\php\ext\
        echo extension=php_sqlsrv_82_nts.dll >> C:\tools\php\php.ini`
GrahamCampbell commented 1 year ago

This is partially fixed, in the sense that the installed version will work on PHP up to and including 8.2, https://github.com/shivammathur/setup-php/pull/766, once this is included in a tagged release.

shivammathur commented 12 months ago

Released 2.26.0 with the fix.

Max84 commented 11 months ago

Thanks 👍