How to activate php_xsl.dll module?

Hello,

I use a composer module in my Symfony 6 app that require php_xsl.dll lib (InkyExtension for email templating)
So I activated it in my .platform.app.yaml

type: php:8.1

runtime:
    extensions:
        - xsl

Though I got the following error when running my app on production :

PHP Warning: PHP Startup: Unable to load dynamic library 'php_xsl.dll' (tried: /usr/lib/php/20210902-zts/php_xsl.dll (/usr/lib/php/20210902-zts/php_xsl.dll: cannot open shared object file: No such file or directory), /usr/lib/php/20210902-zts/php_xsl.dll.so (/usr/lib/php/20210902-zts/php_xsl.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Checked if the module was correctly enabled using symfony ssh 'php -m' and it is in the list

Should I install it as a custom extension as explained here https://docs.platform.sh/languages/php/extensions.html#custom-php-extensions ?

Thank you!

It looks like you’ve probably committed a php.ini file at the root of your app. That file is probably pointing to php_xsl.dll. This tells Platform.sh to load your php.ini file and all of the settings in it.

Platform.sh doesn’t use DLL files, and if it did it would probably live a different path than your local machine anyway. Since you have taken the appropriate step of enabling the XSL extension via the platform.app.yaml, here’s what I’d do next.

  1. Determine which INI files are loaded by PHP: php --ini
  2. Pick one of the INI files outside of your app root and add your php_xsl.dll reference there.
  3. Remove the php_xsl.dll reference form the INI file that you are committing to your project.

Once you have removed the DLL reference from your projects customs php.ini file, you should be able to commit it and run without issue on Platform.sh

Hello @TylerMills ,

Thanks for your answer.

Indeed, I have committed a php.ini file to my project, but this one does not contain any reference to php_xsl.dll

Here it is :

assert.active=off
display_errors=off
display_startup_errors=off
max_execution_time=30
session.use_strict_mode=On
realpath_cache_ttl=3600
zend.detect_unicode=Off

So I actually have no idea where does this dll path come from. Maybe from the composer module ?
It is not a path from my local environment.

The reason I wanted to activate xls is because I had the following error with composer during deployment :

        W: Installing dependencies from lock file (including require-dev)
        W: Verifying lock file contents can be installed on current platform.
        W: Your lock file does not contain a compatible set of packages. Please run composer update.
        W:
        W:   Problem 1
        W:     - lorenzo/pinky is locked to version 1.0.7 and an update of this package was not requested.
        W:     - lorenzo/pinky 1.0.7 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
        W:   Problem 2
        W:     - lorenzo/pinky 1.0.7 requires ext-xsl * -> it is missing from your system. Install or enable PHP's xsl extension.
        W:     - twig/inky-extra v3.4.0 requires lorenzo/pinky ^1.0.5 -> satisfiable by lorenzo/pinky[1.0.7].
        W:     - twig/inky-extra is locked to version v3.4.0 and an update of this package was not requested.
        W:
        W: To enable extensions, verify that they are enabled in your .ini files:
        W:     - /etc/php/8.1-zts/cli/php.ini
        W:     - /app/php.ini
        W: You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
        W: Alternatively, you can run Composer with `--ignore-platform-req=ext-xsl` to temporarily ignore these required extensions.
        W: unable to run /app/.global/bin/composer2 install --prefer-dist --no-scripts --no-progress --no-ansi --no-interaction

      E: Error building project: Step failed with status code 2.

    E: Error: Unable to build application, aborting.

PS: I tried to run composer update as suggested, but it didn’t help, still had the same error

Ok, the issue is fixed now.

I think that I actually misinterpreted the logs, because I first tried to set it up through php.ini, indeed.
I got another error without logs, and I thought it was related, but it seems it is not!

Anyway, thanks a lot for your help !

1 Like

Nice! Just create another post or support ticket if you need help with anything else.