无法加载pdo_sqlite.so扩展名 [英] Unable to load pdo_sqlite.so extension

查看:168
本文介绍了无法加载pdo_sqlite.so扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为cli安装pdo-sqlite ext.

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

我试图运行sudo apt-get install php5-sqlite,它说ext已经是最新的,但是当我运行php -m时,它没有出现在列表中.

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.

在我的/usr/lib/php/文件夹中,我有2个名为20131226和20160303的文件夹.后一个(20160303)包含pdo_sqlite.so,但是当我尝试将其添加到php.ini文件时,出现错误

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

我正在运行ubuntu 14.04和php 5.6.

I am running ubuntu 14.04 and php 5.6.

有人能帮助解决这个问题吗?还有谁能解释为什么php扩展名存储在这些不同编号的文件夹中,以及php如何知道要查找哪个?谢谢.

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.

推荐答案

您已经安装了(至少是一部分)两个不同版本的php,它们之间存在冲突.您可能需要清除未使用的版本,以防止进一步的问题.擦拭两个然后重新安装您想要的一个可能是最简单的.还要确保您的php.ini的extension_dir设置指向您所保留版本的正确目录.

You've got (at least part of) two different versions of php installed, and they're conflicting. You'll probably want to clean out the version you're not using in order to prevent further issues. It might be easiest to just wipe both and then reinstall the one you want. Also make sure that your php.ini has its extension_dir setting pointing to the correct directory for the version you're keeping.

内部PHP API会根据日期进行版本控制,因此,当进行向后不兼容的更改并需要新版本时,您将获得一个新的子目录名称.如果更改 向后兼容,并且不需要新的API版本,那么您可以对PHP版本进行较小的更新,而无需重新编译扩展.

The internal PHP API is versioned according to date, so when backwards-incompatible changes are made and a new version is required, you'll get a new subdirectory name. If the changes are backward-compatible, and no new API version is required, then you can make minor updates to your PHP version without having to recompile your extensions.

我相信20131226适用于PHP 5.6版,而20160303适用于PHP 7版.

I believe 20131226 is for PHP version 5.6 and 20160303 is for PHP version 7.

这篇关于无法加载pdo_sqlite.so扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆