Php 当用户尝试注册时,Magento 1.9抛出500错误
我有Magento版本1.9.3.2。当用户想要注册时,它会生成一个内部服务器错误(HTTP错误代码500)。用户没有收到电子邮件,但已注册 如果我重新加载页面,它会显示消息“感谢您注册”,并且帐户页面已打开 我检查了Magento和Apache的日志-那里什么都没有 有人知道怎么解决这个问题吗 更新。 我打开了index.php文件中的显示错误。我得到消息: [2017年7月5日09:09:01 UTC]PHP致命错误:在第34行的/home/some/public\u html/some/app/code/community/Fooman/EmailAttachments/Model/Core/Email/Template/Mailer.PHP中调用成员函数getPayment() 第34行是这样的: $paymentMethod=$this->getTemplateParams()['order']->getPayment()->getData(“方法”) 所以,似乎有一个块“Fooman”,它试图在未初始化类时使用该类的实例 有人知道这个分机吗 更新。 这个问题似乎是通过这个代码解决的。对于注册,我检查用户是否有类的实例,若他并没有,我使用标准模板Php 当用户尝试注册时,Magento 1.9抛出500错误,php,apache,http,magento,magento-1.9,Php,Apache,Http,Magento,Magento 1.9,我有Magento版本1.9.3.2。当用户想要注册时,它会生成一个内部服务器错误(HTTP错误代码500)。用户没有收到电子邮件,但已注册 如果我重新加载页面,它会显示消息“感谢您注册”,并且帐户页面已打开 我检查了Magento和Apache的日志-那里什么都没有 有人知道怎么解决这个问题吗 更新。 我打开了index.php文件中的显示错误。我得到消息: [2017年7月5日09:09:01 UTC]PHP致命错误:在第34行的/home/some/public\u html/some/a
//here check if have instance of class
if (isset($this->getTemplateParams()['order']))
{
//here 34 string where error occure
$paymentMethod = $this->getTemplateParams()['order']->getPayment()->getData("method");
if ($this->getTemplateId() == '1') {
switch($paymentMethod) {
case 'banktransfer':
$templateId = 9;
break;
case 'paypal_express':
$templateId = 8;
default:
$templateId = $this->getTemplateId();
break;
}
} else {
$templateId = $this->getTemplateId();
}
}
else {
$templateId = $this->getTemplateId();
}
在路径下找不到文件Emogrifier.php时 magento Root/lib/Pelago/Emogrifier.php 检查此文件是否存在,如果不存在,则从fresh magento下载并将其放入其中
清除缓存并重试。如果出现内部服务器错误500,则必须启用显示错误 转到
index.php
并替换代码
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
with Mage::setIsDeveloperMode(true);
and use ini_set('display_errors', 1);
一个接一个地使用这两种方法。在from index.php上取消注释显示错误,然后再次测试,您可能会看到错误文件存在,这没问题。