【发布时间】:2014-02-24 07:00:45
【问题描述】:
我们正在使用 EcomDev 包来测试我们的 Magento 商店,其中一个默认测试正在引起轰动:
运行 phpunit 返回:
5) EcomDev_PHPUnitTest_Test_Helper_Customer::testCustomerSession with data set "jane_doe" (2)
Exception: Warning: session_module_name(): A session is active. You cannot change the session module's ini settings at this time in /var/www/htdocs/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 73
Fatal error: Uncaught exception 'Exception' with message 'Warning: Unknown: Failed to write session data (memcache). Please verify that the current setting of session.save_path is correct (tcp://tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10)
到目前为止,我已经确定:
- Memcache 似乎已打开,并且在正确的端口上
- 当我将它设置为使用外部 (AWS) Memcache 服务时,也会出现同样的问题
- 如果我将会话设置为由文件系统处理,也会发生同样的情况
magento 会话的配置是:
<session_save><![CDATA[memcache]]></session_save>
<session_save_path><![CDATA[tcp://127.0.0.1:11211?persistent=1&weight;=2&timeout;=10&retry;_interval=10]]></session_save_path>
<session_cache_limiter><![CDATA[private]]></session_cache_limiter>
<lifetime>31536000</lifetime>
而php5-fpm php.ini 有
session.save_handler = memcache
session.save_path = "tcp://127.0.0.1:11211?persistent=1&weight;=2&timeout;=10&retry;_interval=10"
【问题讨论】:
标签: php unit-testing magento session phpunit