常见问题:ECJia到家:ECJia到家如何查看错误日志

来自ECJiaWiki
跳转至: 导航搜索

错误案例

当访问网站时出现如下错误友好提示页面:
ECJia到家如何查看错误日志01.png

如何解决

出现错误友好提示页面的时候,可能网站数据库或者服务器配置出现问题导致的,要解决此问题,需要知道错误原因,但是在错误友好提示页面无法查看报错,所以需要查看log日志。


如何查看日志

查看日志有3种方法:

  1. 平台后台的日志查看工具查看错误日志
  2. 服务器/content/storages/logs中查看错误日志
  3. 开启debug模式查看错误日志

后台日志查看工具

  • 登陆平台后台,【控制面板】-【应用管理】-【未安装】,选择【日志查看】,点击安装。
ECJia到家如何查看错误日志04.png
  • 然后在平台后台点击【工具】-【日志查看】
ECJia到家如何查看错误日志05.png

服务器查看错误日志

  • 登录到网站服务器,进入网站根目录,content/storages/logs ,查看 error 开头的日志文件。
ECJia到家如何查看错误日志02.png


开启debug模式

  • 登录到网站服务器,编辑该文件:content/configs/system.php
* 修改如下
//调试开关
'debug'                         => env('DEBUG', true), 
ECJia到家如何查看错误日志03.png

常见错误

  • ship_fpd(运费到付)插件不支持。平台后台查看是否安装此插件,可能是误删除导致的。插件文件夹对应名称可以查看(常出现在到家1.10.0版本):各插件对应目录
[xxxx-xx-xx xx:xx:xx] error.ERROR: Driver [ship_fpd] not supported. {"file":"/ecmoban/www/bootstrap/compiled.php","line":8842,"code":0,"url":"http://www.xxxx.com/index.php?a=init&c=admin_plugin&m=shipping"} []
  • ecjia_area_region b表的表结构不对,正确的表结构应该为“utf8mb4_unicode_ci”,而现在为“utf8mb4_general_ci”,可以使用phpmyadmin找到ecjia_area_region表然后:点击【结构】找到表结构为“utf8mb4_general_ci”的字段手动修改为“utf8mb4_unicode_ci”。
SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '=' (SQL: select r.region_name, r.region_id from `ecjia_area_region` as `a` left join `ecjia_regions` as `r` on a.region_id = r.region_id where a.shipping_area_id = 18) {"file":"/ecmoban/www/xxx.com/bootstrap/compiled.php","line":7570,"code":"HY000","url":"http://xxxx.com/sites/merchant/index.php?a=edit_shipping_template&c=mh_shipping&m=shipping&template_name=xxx"} []
  • 卸载货到付款插件后平台后台不能进入(常出现在到家1.11.0版本) /content/apps/orders/classes/order_query.class.php 109行
		$where[] = "( {$alias}order_status in (" . OS_UNCONFIRMED .",". OS_CONFIRMED.", ". OS_SPLITED.", ". OS_SPLITING_PART.") OR ({$alias}pay_id in (" . $pay_cod . ") and {$alias}order_status in (" . OS_UNCONFIRMED .",". OS_CONFIRMED.", ". OS_SPLITED.", ". OS_SPLITING_PART.") ))";
		$where[$alias.'shipping_status'] = array(SS_UNSHIPPED, SS_SHIPPED_PART, SS_PREPARING, SS_SHIPPED_ING, OS_SHIPPED_PART);
		$where[] = "( {$alias}pay_status in (" . PS_PAYED .",". PS_PAYING.") OR {$alias}pay_id in (" . $payment_id . "))";
		$where[$alias.'is_delete'] = 0;
		return $where;
	}

改为

		if (!empty($pay_cod)) {
			$where[] = "( {$alias}order_status in (" . OS_UNCONFIRMED .",". OS_CONFIRMED.", ". OS_SPLITED.", ". OS_SPLITING_PART.") OR ({$alias}pay_id in (" . $pay_cod . ") and {$alias}order_status in (" . OS_UNCONFIRMED .",". OS_CONFIRMED.", ". OS_SPLITED.", ". OS_SPLITING_PART.") ))";
		} else {
			$where[$alias.'order_status'] = array(OS_UNCONFIRMED, OS_CONFIRMED, OS_SPLITED, OS_SPLITING_PART);
		}
		
		$where[$alias.'shipping_status'] = array(SS_UNSHIPPED, SS_SHIPPED_PART, SS_PREPARING, SS_SHIPPED_ING, OS_SHIPPED_PART);
		$where[] = "( {$alias}pay_status in (" . PS_PAYED .",". PS_PAYING.") OR {$alias}pay_id in (" . $payment_id . "))";
		$where[$alias.'is_delete'] = 0;
		return $where;
	}