2013-12-02 07:20
浏览 96

如何在Ubuntu 13.10上安装PHP PECL扩展“SQLite”

I tried installing using the PECL command from documentation:

$ sudo pecl install SQLite [sudo] password for bogdanbiv: downloading SQLite-1.0.3.tgz ... Starting to download SQLite-1.0.3.tgz (371,189 bytes) .......done: 371,189 bytes 50 source files, building running: phpize Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

So I tried to download the package manually:

$ sudo pecl download SQLite File /home/$USER/Downloads/SQLite-1.0.3.tgz downloaded

These were the first files listed in the archive:

$ tar -tzf SQLite-1.0.3.tgz

SQLite-1.0.3/config.m4 ### config.m4 is in the archive, why isn't it found?
SQLite-.0.3/php_sqlite.h ...

So I unpacked the archive to folder /usr/share/php/SQLite-1.0.3.

/usr/share/php/SQLite-1.0.3$ sudo phpize Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212

After running phpize I would expect PHP to load the SQLite extention, but the only place it appears in the phpinfo page is in the Module Authors (credits). Tried restarting Ubuntu, but even after a restart PHP does not find SQLite.

I am using PECL version only because I saw it as the recomended way to install the PHP SQLite extension. I also tried earlier to install SQLite from Ubuntu packages, also unsuccessful, I will ask that in a separate question.

Disclaimer: I read that using SQLite with sqlite_open is supposed to be deprecated, I just need it to get past an example without which I am blocked.

图片转代码服务由CSDN问答提供 功能建议


< p> $ sudo pecl安装bogdanbiv的SQLite [sudo]密码:下载 SQLite-1.0.3.tgz ...开始下载SQLite-1.0.3.tgz(371,189 bytes)....... 完成:371,189字节50个源文件,构建运行: phpize找不到config.m4。 确保在模块的顶级源目录中运行'/ usr / bin / phpize'


$ sudo pecl下载SQLite 文件/home/$USER/Downloads/SQLite-1.0.3.tgz下载


$ tar -tzf SQLite-1.0.3.tgz

SQLite-1.0.3 / config.m4 ### config.m4在归档中,为什么找不到它?
SQLite-1.0.3 / sqlite.c
SQLite-1.0.3 / sqlite.dsp
SQLite-.0.3 / php_sqlite.h ...


/usr/share/php/SQLite-1.0.3$ sudo phpize 配置: PHP Api版本:20121113 Zend Module Api No: 20121212 Zend Extension Api No:220121212

运行phpize后,我希望PHP加载SQLite扩展,但它在phpinfo页面中出现的唯一位置是 在模块作者(学分)中。 尝试重新启动Ubuntu,但即使重启后PHP也找不到SQLite。

我只使用PECL版本,因为我认为它是安装PHP SQLite扩展的推荐方式。 我之前也尝试过从Ubuntu软件包安装SQLite,也不成功,我会在一个单独的问题中提出这个问题。

免责声明:我读到使用带有sqlite_open的SQLite应该被弃用了,我 只需要它来通过一个没有我被阻止的例子。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douluan4644 2013-12-02 07:31

    I am using PECL version only because I saw it as the recomended way to install the PHP SQLite extension.

    You should not be using the PECL version of this extension, as sqlite support is now part of PHP.

    For saucy, install the php5-sqlite package.

    Installing the sqlite package directly will only install the client and not any integrations or libraries.

    打赏 评论

相关推荐 更多相似问题