php

thinkPHP技巧

it不难
2023-02-27 / 0 评论 / 10 阅读 / 正在检测是否收录...

nginx伪静态配置

server {
    listen       80;

    server_name  www.mytest.cn;
    root  /www/web/web;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    charset utf-8;

    index index.html index.htm index.php;
    location / {
        try_files $uri $uri/ /index.php$uri?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php(.*)$ {
        fastcgi_pass   php:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO  $fastcgi_path_info;
        fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

重置管理员密码

编辑 Application/Admin/Controller/LoginController.class.php
            //输出密码
            $this->ajaxReturn(['errorno' => 1, 'msg' => md5($loginpassword . C('DATA_AUTH_KEY')), 'url' => '']);

            $admin = M("admin");
            $info  = $admin->where(array("username" => $username, "password" => md5($loginpassword . C('DATA_AUTH_KEY'))))->find();
更新数据库admin用户密码(admin@123)
update pay_admin set password = '2a070a7344e2b17d7942119b200ca054' where id = 1;

报错

No input file specified.

0

评论 (0)

取消