如何在PHP 5.4.19版本的Windows中启用PDO_SQLITE [英] How to enabling PDO_SQLITE in PHP Version 5.4.19 windows

查看:68
本文介绍了如何在PHP 5.4.19版本的Windows中启用PDO_SQLITE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在PHP 5.4.19上为SQLite3启用PDO.遵循此-> http://www.php.net/manual/zh/pdo.installation.php

I'm trying to enable PDO for SQLite3 on php 5.4.19. Following this--> http://www.php.net/manual/en/pdo.installation.php

在php.ini文件中取消注释该行的内容:

uncommented the line in the php.ini file that says:

extension=php_pdo_sqlite.dll

;添加下一行 extension = pdo.so

;added next line extension=pdo.so

但是,phpinfo()仍然说:

However, the phpinfo() still says:

PDO

PDO驱动程序没有价值

PDO drivers no value

我认为它会列出SQLite驱动程序.

I would think it would like the SQLite driver would be listed.

尝试进行故障排除,所以我也尝试将其添加到php.ini文件中. 扩展名= php_pdo.dll 但是,/ext文件夹中没有这样的文件,它说在此版本的php中不再需要此文件.

Trying to troubleshoot so I also tried adding this to the php.ini file. extension=php_pdo.dll However, there is no such file in the /ext folder and it says this is no longer needed in this version of php.

我错过了哪一步?

编辑->

好吧,这一点对我所做的任何研究都不是显而易见的. 首先,需要绝对路径,而我找不到任何地方都没有记录.最终设置为:

Ok figured this out and it wasn't obvious to any research I did. First, absolute paths were required which isn't documented anywhere that I could find. Final settings are:

    extension=C:\php\ext\pdo.so
extension=C:\php\ext\php_pdo_sqlite.dll
extension=C:\php\ext\php_sqlite3.dll
[sqlite3]
sqlite3.extension_dir = C:\sqlite

推荐答案

首先,尝试重新启动Web服务器.如果这不起作用,请检查在php.ini中是否正确设置了extension_dir.如果仍然不起作用,请检查是否在phpinfo()输出中读取了正确的php.ini.

First, try restarting your web server. If that doesn't work, check if extension_dir is set properly in php.ini. If that still doesn't work, check if the proper php.ini is being read in the phpinfo() output.

这篇关于如何在PHP 5.4.19版本的Windows中启用PDO_SQLITE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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