使用PECL OS在PHP 5.1.6上安装PDO_MYSQL:Ubuntu [英] Installing PDO_MYSQL on PHP 5.1.6 using PECL OS: Ubuntu
问题描述
我在使PDO_MYSQL工作时遇到真正的问题.
I'm having real problems getting PDO_MYSQL working.
我一开始只是尝试通过PECL安装PDO_MYSQL驱动程序,但是当这种方法不起作用时,我环顾四周,看看是否有任何问题报告.似乎PDO的嵌入式版本和PDO_MYSQL之间可能存在冲突.为此,我决定从PECL重新安装所有依赖项.
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.
环境:
操作系统:Ubuntu
PHP Ver:5.1.6(由于客户端实时环境而无法升级)
OS: Ubuntu
PHP Ver: 5.1.6 (Unable to upgrade due to clients live environment)
遵循的步骤:
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以查看安装了哪些模块.我看到了:
I then check PHPINFO to see which modules are installed. I see:
PDO drivers sqlite2
就是这样!
如果有人可以提出任何解决方案,我将不胜感激.我需要MYSQL PDO驱动程序来为即将进行的项目运行zend框架...是的,由于PHP版本,我必须使用v1.6.
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.
推荐答案
如果您使用的是ubuntu,请尝试apt-get:
If you're on ubuntu, try apt-get :
sudo apt-get install php5-mysql
哪个应该做
/usr/lib/php5/20060613+lfs/pdo.so
和apdo重新启动后即可使用PDO
and PDO will be available after an apache restart
这篇关于使用PECL OS在PHP 5.1.6上安装PDO_MYSQL:Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!