index.php?m=admin&c=login&a=check 404错误

来源:4-5 异步方式实现登录功能—用户信息的数据库校验

大笨拿拿

2016-07-11

学习4-5章时,按照课程编写代码,报如下错误。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

<title>系统发生错误</title>

<style type="text/css">

*{ padding: 0; margin: 0; }

html{ overflow-y: scroll; }

body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }

img{ border: 0; }

.error{ padding: 24px 48px; }

.face{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }

h1{ font-size: 32px; line-height: 48px; }

.error .content{ padding-top: 10px}

.error .info{ margin-bottom: 12px; }

.error .info .title{ margin-bottom: 3px; }

.error .info .title h3{ color: #000; font-weight: 700; font-size: 16px; }

.error .info .text{ line-height: 24px; }

.copyright{ padding: 12px 48px; color: #999; }

.copyright a{ color: #000; text-decoration: none; }

</style>

</head>

<body>

<div class="error">

<p class="face">:(</p>

<h1>SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known</h1>

<div class="content">

<div class="info">

<div class="title">

<h3>错误位置</h3>

</div>

<div class="text">

<p>FILE: /data/webroot/ThinkPHP/Library/Think/Db/Driver.class.php &#12288;LINE: 109</p>

</div>

</div>

<div class="info">

<div class="title">

<h3>TRACE</h3>

</div>

<div class="text">

<p>#0 /data/webroot/ThinkPHP/Library/Think/Db/Driver.class.php(109): E('SQLSTATE[HY000]...')<br />

#1 /data/webroot/ThinkPHP/Library/Think/Db/Driver.class.php(1075): Think\Db\Driver->connect()<br />

#2 /data/webroot/ThinkPHP/Library/Think/Db/Driver/Mysql.class.php(47): Think\Db\Driver->initConnect(true)<br />

#3 /data/webroot/ThinkPHP/Library/Think/Model.class.php(134): Think\Db\Driver\Mysql->getFields('cms_admin')<br />

#4 /data/webroot/ThinkPHP/Library/Think/Model.class.php(122): Think\Model->flush()<br />

#5 /data/webroot/ThinkPHP/Library/Think/Model.class.php(1454): Think\Model->_checkTableInfo()<br />

#6 /data/webroot/ThinkPHP/Library/Think/Model.class.php(97): Think\Model->db(0, '', true)<br />

#7 /data/webroot/ThinkPHP/Common/functions.php(621): Think\Model->__construct('admin', '', '')<br />

#8 /data/webroot/Application/Common/Model/AdminModel.class.php(10): M('admin')<br />

#9 /data/webroot/ThinkPHP/Common/functions.php(596): Common\Model\AdminModel->__construct('Admin')<br />

#10 /data/webroot/Application/Admin/Controller/LoginController.class.php(27): D('Admin')<br />

#11 [internal function]: Admin\Controller\LoginController->check()<br />

#12 /data/webroot/ThinkPHP/Library/Think/App.class.php(173): ReflectionMethod->invoke(Object(Admin\Controller\LoginController))<br />

#13 /data/webroot/ThinkPHP/Library/Think/App.class.php(110): Think\App::invokeAction(Object(Admin\Controller\LoginController), 'check')<br />

#14 /data/webroot/ThinkPHP/Library/Think/App.class.php(204): Think\App::exec()<br />

#15 /data/webroot/ThinkPHP/Library/Think/Think.class.php(120): Think\App::run()<br />

#16 /data/webroot/ThinkPHP/ThinkPHP.php(97): Think\Think::start()<br />

#17 /data/webroot/index.php(24): require('/data/webroot/T...')<br />

#18 {main}</p>

</div>

</div>

</div>

</div>

<div class="copyright">

<p><a title="官方网站" href="http://www.thinkphp.cn">ThinkPHP</a><sup>3.2.3</sup> { Fast & Simple OOP PHP Framework } -- [ WE CAN DO IT JUST THINK ]</p>

</div>

</body>

</html>


写回答

1回答

Scny

2016-07-12

检查一下login控制器是否有check这个方法

1
0

前端到后台ThinkPHP开发整站

用PHP+MySQL+Ajax开完新闻资讯整站,实现“小全栈”的梦想

3360 学习 · 1014 问题

查看课程