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 BehaviorReadHtmlCacheBehavior [ RunTime:0.000030s ] INFO: Run BehaviorCheckLangBehavior [ RunTime:0.000083s ] INFO: Run CommonBehaviorUrldecodeGetBehavior [ 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; } }