問題描述
我在使用 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
和 PDO 將在 apache 重啟后可用
and PDO will be available after an apache restart
這篇關于使用 PECL 操作系統在 PHP 5.1.6 上安裝 PDO_MYSQL:Ubuntu的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!