Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

php - Unable to load pdo_sqlite.so extension

I'm trying to install the pdo-sqlite ext for the cli.

I have tried to run sudo apt-get install php5-sqlite and it says the ext is already up to date but when i run php -m it does not appear in the list.

In my /usr/lib/php/ folder I have 2 folders named 20131226 and 20160303. The latter one (20160303) contains pdo_sqlite.so but when i try to add this to the php.ini file i get the error

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: zend_fetch_resource2_ex in Unknown on line 0

I am running ubuntu 14.04 and php 5.6.

Is anyone able to help with this problem? Also is anyone able to explain why the php extensions are stored in these different numbered folders and how php knows which one to look in? Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I know this question has been answered, but other people might have the same problem as I did. I hope this helps someone, because I spent three f***ing days stuck on this.

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 :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...