在Magento2站点中启用FPC(整页缓存)功能后,它会显示“内部服务器错误500”并且站点未运行。
答案 0 :(得分:1)
最后我收到了来自哪里的错误并设法解决了它。它对我有用。
通过覆盖\ Magento \ Catalog \ Block \ Product \ View
中的函数getIdentities()这
public function getIdentities()
{
$identities = $this->getProduct()->getIdentities();
$category = $this->_coreRegistry->registry('current_category');
if ($category) {
$identities[] = Category::CACHE_TAG . '_' . $category->getId();
}
return $identities;
}
要
public function getIdentities()
{
$identities = [];
if (is_array($this->getItems()) || is_object($this->getItems()))
{
foreach ($this->getItems() as $item)
{
$identities = array_merge($identities, $item->getIdentities());
}
}
return $identities;
}