我知道在整个 stackoverflow 中有几个这个问题的实例,但我没有找到解决方案。
我正在使用 Apache 和 PHP 5.3 运行 CentOS
一个 .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,但问题仍然存在。有什么建议么?