2016-01-25 10:06:15 13842次浏览 2条回答 0 悬赏 50 金钱

我在windows环境下安装的yii2.06 服务器为nginx 配置文件如下:
----------------------yii206------------------

server {

charset utf-8;
client_max_body_size 128M;

listen 80; ## 监听 ipv4 上的 80 端口
#listen [::]:80 default_server ipv6only=on; ## 监听 ipv6 上的 80 端口

server_name yii206.fumin365.com;
root        "G:/phpStudy/WWW/yii206/basic/web";
index       index.php;

access_log  logs/yii206.access.log main;
error_log   logs/yii206.error.log;

location / {
    # 如果找不到真实存在的文件,把请求分发至 index.php
    try_files $uri $uri/ /index.php?$args;
}

若取消下面这段的注释,可避免 Yii 接管不存在文件的处理过程(404)

#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
#    try_files $uri =404;
#}
#error_page 404 /404.html;

location ~ \.php$ {
    include fastcgi.conf;
    fastcgi_pass   127.0.0.1:9000;
    #fastcgi_pass unix:/var/run/php5-fpm.sock;
    try_files $uri =404;
}

location ~ /\.(ht|svn|git) {
    deny all;
}

}

但运行http://yii206.fumin365.com的时间报 “PHP Core Warning – yii\base\ErrorException”请问下是怎么回事?

  • 回答于 2016-01-25 10:12 举报

    具体错误信息?

    1 条回复
    回复于 2016-01-25 10:53 回复
    PHP Core Warning – yii\base\ErrorException 
    
    
    
    
    2.    yii\base\ErrorHandler::handleFatalError()  
    
    
    
    $_SERVER = [
        'ALLUSERSPROFILE' => 'C:\\ProgramData',
        'APPDATA' => 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming',
        'CommonProgramFiles' => 'C:\\Program Files (x86)\\Common Files',
        'CommonProgramFiles(x86)' => 'C:\\Program Files (x86)\\Common Files',
        'CommonProgramW6432' => 'C:\\Program Files\\Common Files',
        'COMPUTERNAME' => 'HCSERVER0',
        'ComSpec' => 'C:\\Windows\\system32\\cmd.exe',
        'FP_NO_HOST_CHECK' => 'NO',
        'LOCALAPPDATA' => 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local',
        'NUMBER_OF_PROCESSORS' => '8',
        'OS' => 'Windows_NT',
        'Path' => 'C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;G:\\phpStudy\\nginx;G:\\phpStudy\\MySQL\\bin',
        'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',
        'PROCESSOR_ARCHITECTURE' => 'x86',
        'PROCESSOR_ARCHITEW6432' => 'AMD64',
        'PROCESSOR_IDENTIFIER' => 'AMD64 Family 21 Model 2 Stepping 0, AuthenticAMD',
        'PROCESSOR_LEVEL' => '21',
        'PROCESSOR_REVISION' => '0200',
        'ProgramData' => 'C:\\ProgramData',
        'ProgramFiles' => 'C:\\Program Files (x86)',
        'ProgramFiles(x86)' => 'C:\\Program Files (x86)',
        'ProgramW6432' => 'C:\\Program Files',
        'PSModulePath' => 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\',
        'PUBLIC' => 'C:\\Users\\Public',
        'SystemDrive' => 'C:',
        'SystemRoot' => 'C:\\Windows',
        'TEMP' => 'C:\\Windows\\TEMP',
        'TMP' => 'C:\\Windows\\TEMP',
        'USERDOMAIN' => 'WORKGROUP',
        'USERNAME' => 'HCSERVER0$',
        'USERPROFILE' => 'C:\\Windows\\system32\\config\\systemprofile',
        'windir' => 'C:\\Windows',
        'HTTP_COOKIE' => '_csrf=0db07ad69971199391e9d318dfa453f551c0c71e0ac5382eef8d4e904b50271ca%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22tHZpMOpWiuAleOTJDj6JXTvibnEqXDRK%22%3B%7D; PHPSESSID=9q1hn8b380865cpt8pdead6nu4',
        'HTTP_CONNECTION' => 'Keep-Alive',
        'HTTP_HOST' => 'yii206.fumin365.com',
        'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
        'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko',
        'HTTP_ACCEPT_LANGUAGE' => 'zh-Hans-CN,zh-Hans;q=0.5',
        'HTTP_ACCEPT' => 'text/html, application/xhtml+xml, */*',
        'REDIRECT_STATUS' => '200',
        'SERVER_NAME' => 'yii206.fumin365.com',
        'SERVER_PORT' => '80',
        'SERVER_ADDR' => '192.168.10.10',
        'REMOTE_PORT' => '6337',
        'REMOTE_ADDR' => '118.183.191.31',
        'SERVER_SOFTWARE' => 'nginx/1.8.0',
        'GATEWAY_INTERFACE' => 'CGI/1.1',
        'SERVER_PROTOCOL' => 'HTTP/1.1',
        'DOCUMENT_ROOT' => 'G:/phpStudy/WWW/yii206/basic/web',
        'DOCUMENT_URI' => '/index.php',
        'REQUEST_URI' => '/',
        'SCRIPT_NAME' => '/index.php',
        'CONTENT_LENGTH' => '<����
    ',
        'CONTENT_TYPE' => '<����
    ',
        'REQUEST_METHOD' => 'GET',
        'QUERY_STRING' => '<����
    ',
        'SCRIPT_FILENAME' => 'G:/phpStudy/WWW/yii206/basic/web/index.php',
        'FCGI_ROLE' => 'RESPONDER',
        'PHP_SELF' => '/index.php',
        'REQUEST_TIME_FLOAT' => 1453690403.190572,
        'REQUEST_TIME' => 1453690403,
    ];
    
    $_COOKIE = [
        '_csrf' => '0db07ad69971199391e9d318dfa453f551c0c71e0ac5382eef8d4e904b50271ca:2:{i:0;s:5:"_csrf";i:1;s:32:"tHZpMOpWiuAleOTJDj6JXTvibnEqXDRK";}',
        'PHPSESSID' => '9q1hn8b380865cpt8pdead6nu4',
    ];
    
    $_SESSION = [
        '__flash' => [],
        '__captcha/site/captcha' => 'mwboju',
        '__captcha/site/captchacount' => 1,
    ];
     
    
    Yii Framework 
    2016-01-25, 10:53:23
    
    nginx/1.8.0
    
    Yii Framework/2.0.6
    
  • 回答于 2016-01-27 10:45 举报

    刷新之后也是这个问题吗?我也出现过该问题,然后采用刷新就可以了,查询资源时有些资源是没有加载进来,是因为装了某些插件导致的该结果,你可以排查一下。

    3 条回复
    回复于 2017-01-05 23:31 回复

    具体怎么解决呢,同样的问题

    回复于 2017-01-06 12:01 回复

    没时间去排查,用了笨的方法,写了个js判断下页面,不行直接自动刷新

    回复于 2017-01-06 14:14 回复

    好吧

您需要登录后才可以回答。登录 | 立即注册
glhcdnco
助理

glhcdnco

注册时间:2014-05-30
最后登录:2016-08-16
在线时长:4小时44分
  • 粉丝1
  • 金钱100
  • 威望0
  • 积分140

热门问题