我知道這個問題在整個stackoverflow中有幾個實例,但我沒有找到解決方案。不能在CentOS上安裝PDO
我正在用CentOS的Apache和PHP 5.3
以.php腳本給我這個錯誤:
Fatal error: Class 'PDO' not found in ...
我跑phpinfo();
和唯一的地方「PDO」存在於網頁中「配置命令」'--disable-pdo'
行。
我試過#yum install php-pdo
但沒有包存在。
我也試圖#pecl install pdo
,我在最後得到這些錯誤:
/root/tmp/pear/PDO/pdo_dbh.c: In function 'pdo_stmt_instantiate':
/root/tmp/pear/PDO/pdo_dbh.c:410: error: 'zval' has no member named 'refcount'
/root/tmp/pear/PDO/pdo_dbh.c:411: error: 'zval' has no member named 'is_ref'
/root/tmp/pear/PDO/pdo_dbh.c: In function 'pdo_stmt_construct':
/root/tmp/pear/PDO/pdo_dbh.c:435: error: 'zend_fcall_info' has no member named 'object_pp'
/root/tmp/pear/PDO/pdo_dbh.c:458: error: 'zend_fcall_info_cache' has no member named 'object_pp'
/root/tmp/pear/PDO/pdo_dbh.c: In function 'zim_PDO_setAttribute':
/root/tmp/pear/PDO/pdo_dbh.c:752: error: 'zval' has no member named 'refcount'
/root/tmp/pear/PDO/pdo_dbh.c: In function 'zim_PDO_getAttribute':
/root/tmp/pear/PDO/pdo_dbh.c:818: error: 'zval' has no member named 'refcount'
/root/tmp/pear/PDO/pdo_dbh.c: In function 'pdo_hash_methods':
/root/tmp/pear/PDO/pdo_dbh.c:1122: warning: assignment discards qualifiers from pointer target type
/root/tmp/pear/PDO/pdo_dbh.c:1126: warning: assignment discards qualifiers from pointer target type
make: *** [pdo_dbh.lo] Error 1
ERROR: `make' failed
然後在php.net的文檔,它基本上說,包裝內附送的,因爲PHP 5.1 PHP安裝標準。
我將行extension=pdo.so
添加到php.ini並重新啓動Apache,問題依然存在。有什麼建議麼?
'php-pdo'是CentOS軟件包的正確名稱。如果你做'yum search php-pdo',它會顯示嗎? –
我得到的唯一結果是yum search pdo是一堆「casenoupdown」包。我也跑yum乾淨所有和yum更新最近 – chuckieDub
也許這是我的問題http://serverfault.com/questions/511779/cant-install-php-pdo – chuckieDub