隐藏PHP/MySQL错误消息 [英] Hiding PHP / MySQL error message

查看:137
本文介绍了隐藏PHP/MySQL错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于 X-Cart 的网站.一切正常.但是,当我访问该地址(手动访问链接)www.mysite.com/"Xx<XaXaXXaXaX>xX时,出现以下错误消息:

I have a website based on X-Cart. It’s working fine. However, when I go to the address (manually accessing the link) www.mysite.com/"Xx<XaXaXXaXaX>xX I get this error message:

无效的SQL: 1064:您有一个 您的SQL语法错误;检查与您的手册相对应的手册 正确的语法的MySQL服务器版本,以在''',, ' LIMIT 1' at line 1<br /><b><font color="darkred">SQL QUERY FAILURE:</font></b>SELECT xid FROM xcart_session_history WHERE ip = INET_ATON('165.193.42.141') AND host = '&quot;XxxXx';&quot;,)'LIMIT附近使用 1
无效的SQL: 1064:您 您的SQL语法有错误;检查对应的手册 您的MySQL服务器版本,以便在附近使用正确的语法 ';',)', 'e8bc1df13aab2c25c7560512a5029eb1')' at line 1<br /><b><font color="darkred">SQL QUERY FAILURE:</font></b>REPLACE INTO xcart_session_history ( ip , host , xid ) VALUES (INET_ATON('165.193.42.141'), '&quot;XxxXx';&quot;,)', 'e8bc1df13aab2c25c7560512a5029eb1')

INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '",)' LIMIT 1' at line 1<br /><b><font color="darkred">SQL QUERY FAILURE:</font></b>SELECT xid FROM xcart_session_history WHERE ip = INET_ATON('165.193.42.141') AND host = '&quot;XxxXx';&quot;,)' LIMIT 1
INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';",)', 'e8bc1df13aab2c25c7560512a5029eb1')' at line 1<br /><b><font color="darkred">SQL QUERY FAILURE:</font></b>REPLACE INTO xcart_session_history (ip,host,xid) VALUES (INET_ATON('165.193.42.141'), '&quot;XxxXx';&quot;,)', 'e8bc1df13aab2c25c7560512a5029eb1')

我发现这是我系统上的漏洞,因为它显示了表名和其他详细信息.

I find this to be a vulnerability on my system because it reveals the table name and other details.

我想防止PHP/MYSQL在屏幕上显示此消息.如何禁用它?

I would like to keep PHP/MYSQL from showing this message on the screen. How can I disable it?

推荐答案

在config.php中将$debug_mode设置为2

Set $debug_mode in config.php to 2

http://help.x- cart.com/index.php?title=X-Cart:Config.php#Correcting_debug_mode

这篇关于隐藏PHP/MySQL错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆