2015-01-21 209 views
0

我想運行Magento Cron作業,但得到此錯誤消息。我檢查了phpinfo()它顯示了一切應該加載和get_loaded_extensions()shows => PDO [27] => pdo_mysql [28] => pdo_sqlite [29]Magento Cron作業失敗,而DLO未加載

任何想到我可以做下一步找到原因?

謝謝, 克里斯

PHP Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with 
message 'The PDO extension is required for this adapter but the extension is 
not loaded' in /home/k117235a/domains/greenman-chris.eu/private_html/lib/Zend/Db/Adapter/Pdo/Abstract.php:342 
Stack trace: 
#0 /home/k117235a/domains/greenman-chris.eu/private_html/lib/Zend/Db/Adapter/Abstract.php(248): 
Zend_Db_Adapter_Pdo_Abstract->setFetchMode(2) 
#1 /home/k117235a/domains/greenman-chris.eu/private_html/app/code/core/Mage/Core/Model/Resource.php(175): 
Zend_Db_Adapter_Abstract->__construct(Array) 
#2 /home/k117235a/domains/greenman-chris.eu/private_html/app/code/core/Mage/Core/Model/Resource.php(110): 
Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element)) 
#3 /home/k117235a/domains/greenman-chris.eu/private_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): 
Mage_Core_Model_Resource->getConnection('core_write') 
#4 /home/k117235a/domains/greenman-chris.eu/private_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract 
in /home/k117235a/domains/greenman-chris.eu/private_html/lib/Zend/Db/Adapter/Pdo/Abstract.php 
on line 342 

回答

0

也許你正在檢查從瀏覽器中的phpinfo(),但延長的可能裝入只是阿帕奇/ nginx的,而不是命令行,這是我是如何假設cronjob php文件將運行。

檢查擴展爲CLI啓用,通常在以下位置:

/etc/php5/cli/conf.d/20-pdo_mysql.ini (the name might not be exactly the same) 

它可能是隻對在/ etc/PHP5/Apache2的/或者/ etc/PHP5/PHP-FPM/

可以剛剛從其他地方複製或創建具有以下內容的新文件:

extension=pdo_mysql.so 

,入住該擴展是通過命令行運行加載後:

php -i | grep pdo 

如果它被加載,你應該看到一些輸出和cronjob現在應該工作。

我希望它有幫助。

0

使用「$ which php」來確保您使用的是您認爲自己的PHP。
看看在php.ini你的PHP命令行使用,並看看是否有任何附加信息已停用

0

的另一種方法是讓Apache通過使用wget運行cron作業:

[specified time] wget -q http://magento.url.com/cron.php 

使用這種方法也有助於在文件權限有問題的情況下(特別是涉及到Magento的緩存時)。