在我的生产服务器上,我已将环境设置为' production'在Codigniter的index.php文件中:
define('ENVIRONMENT', 'production');
下面的案例陈述看起来也做了正确的事情(我还没有改变它)。
然而,PHP错误仍在显示,例如:
A Database Error Occurred
Error Number: 1054
Unknown column 'laassad' in 'field list'
SELECT laassad FROM contents LIMIT 1
Filename: /home/something/public_html/mysite/somemorestuff.php
Line Number: 11
这显然没有吸引力,存在安全风险。有谁知道可能导致这种行为的原因以及我如何解决这个问题?
我正在使用' CI_VERSION',' 2.1.2'
答案 0 :(得分:2)
将您的环境定义为生产只会抑制PHP错误 - 这是数据库错误。
请参阅此主题以获取答案:How to turn off mysql errors from being displayed to screen in CodeIgniter