PHP Startup: Unable to load dynamic library '/

2019-04-02 19:31发布

I'm getting this warning when running the phpunit test suite in Jenkins pipeline.

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/pdo_sqlite.so' - /usr/lib/php/20160303/pdo_sqlite.so: undefined symbol: sqlite3_column_table_name in Unknown on line 0

However this warning is not thrown when running the test suite directly in terminal.

I have PHP 7.1 in my system and this is the only PHP version I have installed. php7.1-sqlite3 is installed.

Thank you in advance.

2条回答
beautiful°
2楼-- · 2019-04-02 20:03

As far as I have found out, there is a faulty file in /usr/local/lib called libsqlite3.so.0 which points to libsqlite3.so.0.8.6. I renamed the file in case it was needed for something. With the command:

cd /usr/local/lib sudo mv libsqlite3.so.0 ./libsqlite3.so.0.back

But you can also delete it: rm libsqlite3.so.0

The thread that lead me to the answer: link

This solved my problems, and I hope they solve yours as well :)

查看更多
Viruses.
3楼-- · 2019-04-02 20:21

I had this same issue with PHP 7.1 on Ubuntu 16.04.

Running the following fixed the issue for me:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1-sqlite3
查看更多
登录 后发表回答