我对 magento 命令有疑问:php shell/indexer.php reindexall
堆栈跟踪:
0 /home/taatoo/www/lib/Zend/Db/Adapter/Abstract.php(459): > Varien_Db_Adapter_Pdo_Mysql->_connect()
1 /home/taatoo/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
2 /home/taatoo/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
3 /home/taatoo/www/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
4 /home/taatoo/www/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
5 /home/taatoo/www/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
6 /home/taatoo/www/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350):/home/taatoo/www/lib/Varien/Db/Adapter/Pdo/中的Mage_Core 302行的mysql.php
第 301/302/303 行是:
if (!extension_loaded('pdo_mysql')) {
throw new Zend_Db_Adapter_Exception('pdo_mysql extension is not installed');
}
或者,如果我print_r(get_loaded_extensions());
在 /home/project/www/ 或 /home/project/www/lib/Varien/Db/Adapter/Pdo/ 中执行,我会正确获得“pdo_mysql”扩展名。
true
如果我var_dump(extension_loaded('pdo_mysql'));
在这个脚本中这样做,我也会得到。
但是false
如果我在 /home/project/www/lib/Varien/Db/Adapter/Pdo/Mysql.php 做同样的事情