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

时间:2023-01-12 18:09:41

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

查看Logs日志记录:

[ --29T09::+: ] 113.108.11.52 /icloud/index.php?g=user&m=index&a=is_login
INFO: [ app_begin ] --START--
INFO: Run Behavior\ReadHtmlCacheBehavior [ RunTime:.000030s ]
INFO: Run Behavior\CheckLangBehavior [ RunTime:.000083s ]
INFO: Run Common\Behavior\UrldecodeGetBehavior [ RunTime:.000031s ]
INFO: [ app_begin ] --END-- [ RunTime:.000215s ]
NOTIC: [] Undefined index: url application/Common/Controller/AppframeController.class.php 第 行.

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

$data=array();

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

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

server {
listen default_server;
listen [::]: 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 .
# try_files $uri $uri/ =;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules location ~ \.php$ {
fastcgi_pass 127.0.0.1:;
# 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:;
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 /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
location ~ /Uploads/.*\.php$ {
deny all; }
location ~ \.php/ {
if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) { }
fastcgi_pass 127.0.0.1:;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_NAME $;
fastcgi_param PATH_INFO $;
fastcgi_param SCRIPT_FILENAME $document_root$; } # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}