thinkphp关闭调试模式(APP_DEBUG => false),导致程序出错


thinkphp关闭调试模式(APP_DEBUG => false),导致程序出错,开启调试模式,不报错,怎么解决?

查看Logs日志记录:

[ 2016-11-29T09:14:34+08:00 ] 113.108.11.52 /icloud/index.php?g=user&m=index&a=is_login
INFO: [ app_begin ] --START--
INFO: Run Behavior\ReadHtmlCacheBehavior [ RunTime:0.000030s ]
INFO: Run Behavior\CheckLangBehavior [ RunTime:0.000083s ]
INFO: Run Common\Behavior\UrldecodeGetBehavior [ RunTime:0.000031s ]
INFO: [ app_begin ] --END-- [ RunTime:0.000215s ]
NOTIC: [8] Undefined index: url application/Common/Controller/AppframeController.class.php 第 22 行.

报Undefined index,索引错误,但告警级别只是NOTICE,按路径查看源代码,加一个数组声明语句:

$data=array();

=========================

附上一个阿里云搭建tomcat 和 php环境的nginx配置

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    index index.php index.html index.htm;

    # Make site accessible from http://localhost/
    server_name www.sysucloud.edu.cn localhost sysucloud;

    location /icloud {
        root /var/www/html;
        index index.html index.php;
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        #        try_files $uri $uri/ =404;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules

        location ~ \.php$ {
            fastcgi_pass 127.0.0.1:9000;
        #    fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_index index.php;
        }

    }
    # tomcat 代理转发
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        # proxy_redirect http://host:8080 http://$host:$server_port;

        access_log /var/log/nginx/tomcat_access.log;
        error_log /var/log/nginx/tomcat_error.log;
    }

    # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
    #    location /RequestDenied {
    #        proxy_pass http://127.0.0.1:8080;    
    #    }

    error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ /Uploads/.*\.php$ {
        deny all;

    }
    location ~ \.php/ {
        if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) {  }
        fastcgi_pass 127.0.0.1:9000;
       # fastcgi_pass unix:/var/run/php5-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_NAME     $1;
        fastcgi_param PATH_INFO       $2;
        fastcgi_param SCRIPT_FILENAME $document_root$1;

    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
        deny all;
    }
    }

优质内容筛选与推荐>>
1、第一次作业
2、获取当前日期是星期几
3、AJAX方式的ET的使用
4、后台传参数,不能用&para作为参数,IE浏览器会默认解析成乱码
5、A302应用开发中基础功能的经验总结


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号





    联系我们

    欢迎来到TinyMind。

    关于TinyMind的内容或商务合作、网站建议,举报不良信息等均可联系我们。

    TinyMind客服邮箱:support@tinymind.net.cn