http://qs321.pair.com?node_id=11149246


in reply to Re^2: Perl XAMPP DB Connect issue (Windows/Strawberry?)
in thread Perl XAMPP DB Connect issue (Windows/Strawberry?)

Is the Strawberry Perl c\bin directory in your path? If not then external DLLs cannot be located by the system and nothing that depends on them will work. In this case the file you refer to, mysql.xs.dll depends on libmysql__.dll. If that file is not in the path then the bindings will not work. The .xs.dll file is also the compiled XS bindings, not the mysql DLL.

If you have downloaded a portable version of Strawberry perl, which from memory is what Chocolatey distributes, then you need to run the portableshell.bat script to set up the paths, or manually prepend them to your path. This script is at the top level of the Strawberry perl distribution.

(Edited a few minutes after posting to clarify reference to .xs.dll file.)

Replies are listed 'Best First'.
Re^4: Perl XAMPP DB Connect issue (Windows/Strawberry?)
by Polyglot (Chaplain) on Jan 01, 2023 at 04:53 UTC
    There is no "portableshell.bat" anywhere in the xampp directory tree. The only thing "portable" is a "Portable.pm" in the "C:\xampp\perl\vendor\lib\" and "C:\xampp\perl\vendor\lib\CPAN\Mini\" directories -- the former having 6,643 bytes as compared to the 388 bytes of the latter. I doubt they are what is needed.

    Blessings,

    ~Polyglot~

      In that case you can download the batch script from the Strawberry Perl github repo and save it to the top level of the perl distribution on your machine.

      Edit: Although you note in 11149261 that you have already downloaded a portable strawberry perl so should have this file.

      However, if all you want is to add the relevant paths then you can also run this code in your cmd shell before calling any perl code, updating the first path accordingly:

      set ST_PATH=c:\path\to\strawberry_perl_dir set PATH=%ST_PATH%\perl\site\bin;%ST_PATH%\bin;%ST_PATH%\c\bin;%PATH%

      If you are using powershell then the process is the same but the syntax will differ.

      The above process can also be done in a BEGIN block in your perl scripts but that does not help with running other perl scripts not under your control such as Makefile.PL scripts.

      Edit 2: All the above assumes you are working with a Strawberry Perl distribution. The XAMPP distribution does not include the c/bin directory. It also seems to be compiled using MSVC which, if I understand things correctly, means its DLLs will not work with Strawberry Perl since it is compiled using MINGW GCC. So you will likely need to find some way for your application to call out to the Strawberry Perl stack and not the XAMPP perl stack.