snowflakedb / pdo_snowflake

PHP PDO driver for snowflake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_snowflake.so'

alexsanzharovskiy opened this issue · comments

Hello!
I'm trying to add pdo_snowflake extension in my php 7.4.25.
What I'm using:

  1. Centos 7
  2. PHP 7.4.25

What I did:

export PHP_HOME=/usr
 git clone https://github.com/snowflakedb/pdo_snowflake.git
cd pdo_snowflake
./scripts/build_pdo_snowflake.sh

-----------> Result:

build complete.
Don't forget to run 'make test'.

Linking for Linux
libtool: install: cp ./.libs/pdo_snowflake.so /opt/pdo_snowflake/modules/pdo_snowflake.so
libtool: install: cp ./.libs/pdo_snowflake.lai /opt/pdo_snowflake/modules/pdo_snowflake.la
libtool: finish: PATH="/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /opt/pdo_snowflake/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/pdo_snowflake/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

And then after this command:

$PHP_HOME/bin/php -dextension=modules/pdo_snowflake.so -m | grep pdo_snowflake

I've got this response:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_snowflake.so' (tried: /usr/lib64/php/modules/pdo_snowflake.so (/usr/lib64/php/modules/pdo_snowflake.so: undefined symbol: _ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE), /usr/lib64/php/modules/pdo_snowflake.so.so (/usr/lib64/php/modules/pdo_snowflake.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

And even when I'm creating file: 20-pdo_snowflake.ini
With content:
extension=pdo_snowflake.so
pdo_snowflake.cacert=/etc/php.d/cacert.pem

cp modules/pdo_snowflake.so /usr/lib64/php/modules/
cp libsnowflakeclient/cacert.pem /etc/php.d/cacert.pem

I have this issue:

$ php -v
$ PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_snowflake.so' (tried: /usr/lib64/php/modules/pdo_snowflake.so (/usr/lib64/php/modules/pdo_snowflake.so: undefined symbol: _ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE), /usr/lib64/php/modules/pdo_snowflake.so.so (/usr/lib64/php/modules/pdo_snowflake.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Hi!
Today I've also had same issue. Simply change command to:
$PHP_HOME/bin/php -dextension=modules/pdo_snowflake.so -m | grep pdo_snowflake

Because if you would check command response there is double .so.

commented

I've had this issue with Centos 7 but I think it ended up being that the gcc version available on yum is not high enough for what the driver needs.

I am also running into the same module not found issue on RHEL 8. Cloning the v.1.1.0 tag fixed it for me

To clean up and re-prioritize more pressing bugs and feature requests we are closing all issues older than 6 months as of April 1, 2023. If there are any issues or feature requests that you would like us to address, please create them according to the new templates we have created. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response.