使用 PECL 操作系统在 PHP 5.1.6 上安装 PDO_MYSQL:Ubuntu
我在让 PDO_MYSQL 工作时遇到了真正的问题。
我一开始只是尝试通过 PECL 安装 PDO_MYSQL 驱动程序,但是当这不起作用时,我四处查看是否报告了任何问题。 看来PDO的嵌入版本和PDO_MYSQL之间可能存在冲突。 为此,我决定从 PECL 重新安装它的所有依赖项。
环境:
操作系统:Ubuntu
PHP 版本:5.1.6(由于客户端实时环境而无法升级)
步骤如下:
PECL uninstall PDO_MYSQL
PECL uninstall PDO
PECL uninstall mysql
PECL install mysql
PECL install PDO
PECL install PDO_MYSQL
Lines Added to PHP.ini
extension=mysql.so
extension=pdo.so
extension=pdo_mysql.so
apachectl restart
[warn] php5_module is already loaded, skipping
然后我检查 PHPINFO 以查看安装了哪些模块。 我明白了:
PDO drivers sqlite2
就是这样!
如果有人能对此提出任何解决方案,我将不胜感激。 我需要 MYSQL PDO 驱动程序来为即将进行的项目运行 zend 框架...是的,由于 PHP 版本,我必须使用 v1.6。
I'm having real problems getting PDO_MYSQL working.
I started by just trying to install the PDO_MYSQL driver via PECL, however when this didn't work I looked round to see if there where any issues reported. It seems that there may be a conflict between the embedded version of PDO and PDO_MYSQL. To that end i decided to reinstall all it's dependencies from PECL.
Environment:
OS: Ubuntu
PHP Ver: 5.1.6 (Unable to upgrade due to clients live environment)
Procedure Followed:
PECL uninstall PDO_MYSQL
PECL uninstall PDO
PECL uninstall mysql
PECL install mysql
PECL install PDO
PECL install PDO_MYSQL
Lines Added to PHP.ini
extension=mysql.so
extension=pdo.so
extension=pdo_mysql.so
apachectl restart
[warn] php5_module is already loaded, skipping
I then check PHPINFO to see which modules are installed. I see:
PDO drivers sqlite2
That's it!
If any one could suggest any solutions to this I'd be deeply grateful. I need MYSQL PDO driver to run zend framework for an upcoming project... and yes I have to use v1.6 due to the PHP version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 ubuntu,请尝试 apt-get :
这应该使
PDO 在 apache 重新启动后可用
If you're on ubuntu, try apt-get :
which should make
and PDO will be available after an apache restart
对于任何有此问题的人,请确保安装了“libmysqlclient15-dev”库:
然后使用:
如果没有“libmysqlclient15-dev”库,您将遇到 pdo 问题。
发现这些页面非常有帮助:
http://pecl.php.net/ bugs/bug.php?id=12141
http://ubuntuforums.org/showthread.php?t=474152
To anyone having problems with this ensure that the 'libmysqlclient15-dev' library is installed:
Then use:
Without the 'libmysqlclient15-dev' library you'll have problems with pdo.
Found these pages to be quite helpful:
http://pecl.php.net/bugs/bug.php?id=12141
http://ubuntuforums.org/showthread.php?t=474152