使用PECL OS在Ubuntu上安装PDO_MYSQL在PHP 5.1.6上

时间:2022-09-19 14:33:45

I'm having real problems getting PDO_MYSQL working.

我在使PDO_MYSQL工作时遇到了实际问题。

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.

我开始只是尝试通过PECL安装PDO_MYSQL驱动程序,但是当这不起作用时,我仔细查看是否有任何问题报告。似乎PDO的嵌入版本与PDO_MYSQL之间可能存在冲突。为此,我决定从PECL重新安装它的所有依赖项。

Environment:

OS: Ubuntu
PHP Ver: 5.1.6 (Unable to upgrade due to clients live environment)

操作系统:Ubuntu PHP Ver:5.1.6(由于客户端环境无法升级)

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:

然后我检查PHPINFO以查看安装了哪些模块。我知道了:

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.

如果任何人可以提出任何解决方案,我将深表感激。我需要MYSQL PDO驱动程序来为即将到来的项目运行zend框架......是的,由于PHP版本,我必须使用v1.6。

2 个解决方案

#1


If you're on ubuntu, try apt-get :

如果您使用的是ubuntu,请尝试使用apt-get:

sudo apt-get install php5-mysql

which should make

应该做的

/usr/lib/php5/20060613+lfs/pdo.so

and PDO will be available after an apache restart

apache重启后,PDO将可用

#2


To anyone having problems with this ensure that the 'libmysqlclient15-dev' library is installed:

对于遇到此问题的任何人,请确保安装了“libmysqlclient15-dev”库:

sudo apt-get install libmysqlclient15-dev

Then use:

sudo apt-get install pdo_mysql

Without the 'libmysqlclient15-dev' library you'll have problems with pdo.

如果没有'libmysqlclient15-dev'库,你将遇到pdo问题。

Found these pages to be quite helpful:

发现这些页面非常有用:

http://pecl.php.net/bugs/bug.php?id=12141
http://ubuntuforums.org/showthread.php?t=474152

#1


If you're on ubuntu, try apt-get :

如果您使用的是ubuntu,请尝试使用apt-get:

sudo apt-get install php5-mysql

which should make

应该做的

/usr/lib/php5/20060613+lfs/pdo.so

and PDO will be available after an apache restart

apache重启后,PDO将可用

#2


To anyone having problems with this ensure that the 'libmysqlclient15-dev' library is installed:

对于遇到此问题的任何人,请确保安装了“libmysqlclient15-dev”库:

sudo apt-get install libmysqlclient15-dev

Then use:

sudo apt-get install pdo_mysql

Without the 'libmysqlclient15-dev' library you'll have problems with pdo.

如果没有'libmysqlclient15-dev'库,你将遇到pdo问题。

Found these pages to be quite helpful:

发现这些页面非常有用:

http://pecl.php.net/bugs/bug.php?id=12141
http://ubuntuforums.org/showthread.php?t=474152